File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed 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(
148148 ) ;
149149 console . log ( ) ;
150150
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+
151159 if ( fs . existsSync ( paths . yarnLockFile ) ) {
152160 console . log ( cyan ( 'Running yarn...' ) ) ;
153- fs . removeSync ( ownPath ) ;
154161 spawnSync ( 'yarnpkg' , [ ] , { stdio : 'inherit' } ) ;
155162 } else {
156163 console . log ( cyan ( 'Running npm install...' ) ) ;
157- fs . removeSync ( ownPath ) ;
158164 spawnSync ( 'npm' , [ 'install' ] , { stdio : 'inherit' } ) ;
159165 }
160166 console . log ( green ( 'Ejected successfully!' ) ) ;
You can’t perform that action at this time.
0 commit comments