File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -82,10 +82,11 @@ const installNpmDeps = projectPath => {
82
82
// user's machine. This can have unintended side-effects, such as generating
83
83
// a lock file with the wrong version. Temporarily rename the whole folder
84
84
// to avoid this.
85
- fs . renameSync (
86
- path . join ( rootDir , "node_modules" , ".bin" ) ,
87
- path . join ( rootDir , "node_modules" , ".bin.ignore" )
88
- ) ;
85
+ const localBinDir = path . join ( rootDir , "node_modules" , ".bin" ) ;
86
+ const localBinDirRenamed = `${ localBinDir } .ignore` ;
87
+ if ( fs . existsSync ( localBinDir ) ) {
88
+ fs . renameSync ( localBinDir , localBinDirRenamed ) ;
89
+ }
89
90
90
91
try {
91
92
// First install existing deps.
@@ -116,10 +117,9 @@ const installNpmDeps = projectPath => {
116
117
)
117
118
) ;
118
119
} finally {
119
- fs . renameSync (
120
- path . join ( rootDir , "node_modules" , ".bin.ignore" ) ,
121
- path . join ( rootDir , "node_modules" , ".bin" )
122
- ) ;
120
+ if ( fs . existsSync ( localBinDirRenamed ) ) {
121
+ fs . renameSync ( localBinDirRenamed , localBinDir ) ;
122
+ }
123
123
}
124
124
} ;
125
125
You can’t perform that action at this time.
0 commit comments