Skip to content

Commit fe108be

Browse files
committed
remove bin files after eject defined at package.json
1 parent 075e729 commit fe108be

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/react-scripts/scripts/eject.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,17 @@ prompt(
149149
);
150150
console.log();
151151

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+
152158
if (fs.existsSync(paths.yarnLockFile)) {
153159
console.log(cyan('Running yarn...'));
154-
fs.removeSync(ownPath);
155160
spawnSync('yarnpkg', [], {stdio: 'inherit'});
156161
} else {
157162
console.log(cyan('Running npm install...'));
158-
fs.removeSync(ownPath);
159163
spawnSync('npm', ['install'], {stdio: 'inherit'});
160164
}
161165
console.log(green('Ejected successfully!'));

0 commit comments

Comments
 (0)