File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
packages/react-scripts/scripts Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -148,13 +148,19 @@ prompt(
148
148
) ;
149
149
console . log ( ) ;
150
150
151
+ try {
152
+ // remove react-scripts and react-scripts binaries from app node_modules
153
+ Object . keys ( ownPackage . bin ) . forEach ( function ( binKey ) {
154
+ fs . removeSync ( path . join ( appPath , 'node_modules' , '.bin' , binKey ) ) ;
155
+ } ) ;
156
+ fs . removeSync ( ownPath ) ;
157
+ } catch ( e ) { }
158
+
151
159
if ( fs . existsSync ( paths . yarnLockFile ) ) {
152
160
console . log ( cyan ( 'Running yarn...' ) ) ;
153
- fs . removeSync ( ownPath ) ;
154
161
spawnSync ( 'yarnpkg' , [ ] , { stdio : 'inherit' } ) ;
155
162
} else {
156
163
console . log ( cyan ( 'Running npm install...' ) ) ;
157
- fs . removeSync ( ownPath ) ;
158
164
spawnSync ( 'npm' , [ 'install' ] , { stdio : 'inherit' } ) ;
159
165
}
160
166
console . log ( green ( 'Ejected successfully!' ) ) ;
You can’t perform that action at this time.
0 commit comments