Skip to content
This repository has been archived by the owner. It is now read-only.

npm install fails in windows using fsevents #17671

Closed
kylelamse opened this issue Jul 7, 2017 · 185 comments

Comments

Projects
None yet
@kylelamse
Copy link

commented Jul 7, 2017

I'm opening this issue because:

  • npm is crashing.
  • npm is producing an incorrect install.
  • npm is doing something I don't understand.
  • Other (see below for feature requests):

What's going wrong?

When doing an npm install with just a package.json, I get an EPERM which causes an error and installation aborts.

Here is the console output:

C:\Users\kyle.lamse\Code\typescript-webpack>npm i
npm ERR! path C:\Users\kyle.lamse\Code\typescript-webpack\node_modules\fsevents\
node_modules\getpass\node_modules
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall scandir
npm ERR! Error: EPERM: operation not permitted, scandir 'C:\Users\kyle.lamse\Cod
e\typescript-webpack\node_modules\fsevents\node_modules\getpass\node_modules'
npm ERR!     at Error (native)
npm ERR!  { Error: EPERM: operation not permitted, scandir 'C:\Users\kyle.lamse\
Code\typescript-webpack\node_modules\fsevents\node_modules\getpass\node_modules'

npm ERR!     at Error (native)
npm ERR!   stack: 'Error: EPERM: operation not permitted, scandir \'C:\\Users\\k
yle.lamse\\Code\\typescript-webpack\\node_modules\\fsevents\\node_modules\\getpa
ss\\node_modules\'\n    at Error (native)',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'scandir',
npm ERR!   path: 'C:\\Users\\kyle.lamse\\Code\\typescript-webpack\\node_modules\
\fsevents\\node_modules\\getpass\\node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\kyle.lamse\AppData\Roaming\npm-cache\_logs\2017-07-07T16_0
3_08_624Z-debug.log

What's really strange is that it tries to use fsevents which shouldn't be able to be installed/used on Windows. I remember when using npm 5.0.4 there were issues with fsevents which was supposed to be fixed by @zkat in #17552. However, I'm not sure if this issue is related. When I downgrade to npm@4, the issue does not occur.

How can the CLI team reproduce the problem?

Use this package.json in Windows:
package.json

Run an npm install

Here is the npm-debug.log file:
npm-debug.log

supporting information:

  • npm -v prints: 5.1.0
  • node -v prints: v6.11.0
  • npm config get registry prints: https://registry.npmjs.org/
  • Windows, OS X/macOS, or Linux?: Windows 7 Enterprise 64 bit
@kylelamse

This comment has been minimized.

Copy link
Author

commented Jul 7, 2017

Update:

I tried doing an npm install in a fresh directory with the package.json being the only thing in it. It worked fine, but when I ran npm i -D css-loader, I get the same issue as listed in the comment above.

console output:

C:\Users\kyle.lamse\Desktop\typescript-webpack>npm i -D css-loader
npm ERR! path C:\Users\kyle.lamse\Desktop\typescript-webpack\node_modules\fseven
ts\node_modules\getpass\node_modules
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall lstat
npm ERR! Error: EPERM: operation not permitted, lstat 'C:\Users\kyle.lamse\Deskt
op\typescript-webpack\node_modules\fsevents\node_modules\getpass\node_modules'
npm ERR!     at Error (native)
npm ERR!  { Error: EPERM: operation not permitted, lstat 'C:\Users\kyle.lamse\De
sktop\typescript-webpack\node_modules\fsevents\node_modules\getpass\node_modules
'
npm ERR!     at Error (native)
npm ERR!   stack: 'Error: EPERM: operation not permitted, lstat \'C:\\Users\\kyl
e.lamse\\Desktop\\typescript-webpack\\node_modules\\fsevents\\node_modules\\getp
ass\\node_modules\'\n    at Error (native)',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'lstat',
npm ERR!   path: 'C:\\Users\\kyle.lamse\\Desktop\\typescript-webpack\\node_modul
es\\fsevents\\node_modules\\getpass\\node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\kyle.lamse\AppData\Roaming\npm-cache\_logs\2017-07-07T16_3
3_01_899Z-debug.log

npm-debug.log

@zkat zkat added bug npm5 labels Jul 7, 2017

@egoroof

This comment has been minimized.

Copy link

commented Jul 9, 2017

Have the same problem (Windows 10, node 8.1.3). It was ok in 5.0.3 but after updating to 5.1.0 (with npm i -g npm) got this behavior: clean install (without node_modules folder) is ok (and looks faster, maybe faster than yarn?). But when there are installed dependencies exist running npm i causes the problem with fsevents on Windows.

@vascofernandes

This comment has been minimized.

Copy link

commented Jul 10, 2017

Same problem.

Windows Server 2016 x64
Node 8.0.0
NPM 5.1.0


 2017-07-10T08:34:02.3867032Z > uglifyjs-webpack-plugin@0.4.6 postinstall E:\BldWork\2017.1\2\s\XXXXXXXXXXXXXXXXXX\node_modules\uglifyjs-webpack-plugin
2017-07-10T08:34:02.3867032Z > node lib/post_install.js
2017-07-10T08:34:02.3867032Z 
2017-07-10T08:34:16.3554135Z npm ERR! path E:\BldWork\2017.1\2\s\XXXXXXXXXXXXXXXXXX\node_modules\fsevents\node_modules\dashdash\node_modules
2017-07-10T08:34:16.3554135Z npm ERR! code EPERM
2017-07-10T08:34:16.3554135Z npm ERR! errno -4048
2017-07-10T08:34:16.3554135Z npm ERR! syscall scandir
2017-07-10T08:34:16.3554135Z npm ERR! Error: EPERM: operation not permitted, scandir 'E:\BldWork\2017.1\2\s\XXXXXXXXXXXXXXXXXX\node_modules\fsevents\node_modules\dashdash\node_modules'
2017-07-10T08:34:16.3554135Z npm ERR!  { Error: EPERM: operation not permitted, scandir 'E:\BldWork\2017.1\2\s\XXXXXXXXXXXXXXXXXX\node_modules\fsevents\node_modules\dashdash\node_modules'
2017-07-10T08:34:16.3554135Z npm ERR!   stack: 'Error: EPERM: operation not permitted, scandir \'E:\\BldWork\\2017.1\\2\\s\\XXXXXXXXXXXXXXXXXX\\node_modules\\fsevents\\node_modules\\dashdash\\node_modules\'',
2017-07-10T08:34:16.3554135Z npm ERR!   errno: -4048,
2017-07-10T08:34:16.3554135Z npm ERR!   code: 'EPERM',
2017-07-10T08:34:16.3554135Z npm ERR!   syscall: 'scandir',
2017-07-10T08:34:16.3554135Z npm ERR!   path: 'E:\\BldWork\\2017.1\\2\\s\\XXXXXXXXXXXXXXXXXX\\node_modules\\fsevents\\node_modules\\dashdash\\node_modules' }
2017-07-10T08:34:16.3554135Z npm ERR! 
2017-07-10T08:34:16.3554135Z npm ERR! Please try running this command again as root/Administrator.
2017-07-10T08:34:16.4647883Z 
@markwhitfeld

This comment has been minimized.

Copy link

commented Jul 11, 2017

Same here, fails in 5.1.0 but works in 5.0.3.
Fails even if I delete the node_modules folder before running 'npm install'.
(Windows 10, node v7.9.0)

@CarolineBoyer

This comment has been minimized.

Copy link

commented Jul 11, 2017

Same problem. Uploading to npm 5.2.0 didn't seem to do the trick either.
However ( might be a coincidence) doing npm cache verify then npm i my package again worked.

@pocesar

This comment has been minimized.

Copy link

commented Jul 12, 2017

this was a real blocker, had to go back to npm@4.6.1. the EPERM error is constant in Windows 10 (latest updates). although it DOESN'T seem like a problem with permissions per se, it looks like npm (or node) is being picky about how many processes are currently reading from the same file (ie: vscode, antivirus scanners, firewalls, having the explorer folder open, cmd.exe, etc). when I shutdown everything, it works 90% of the time.
react-native (related) metro bundler happens to have the same problem, so it goes beyond npm itself. when compiling the react-native Java project, I have to close everything else it'll EPERM out

@gforceg

This comment has been minimized.

Copy link

commented Jul 13, 2017

I'm getting the same error in windows 10 npm 5.2.0.
I deleted node_modules and ran npm cahce verify and it seemed to work. but if I add another package to my project via 'npm i --save <some_package>' I bet it will fail again.

@bohoffi

This comment has been minimized.

Copy link

commented Jul 14, 2017

I solved the issue by returning to npm@5.0.3 but I hope that it will get fixed so that I can update again.

@zkat

This comment has been minimized.

Copy link
Member

commented Jul 14, 2017

gonna take a look at this. This is weird.

@zkat

This comment has been minimized.

Copy link
Member

commented Jul 14, 2017

Heads up: I'm unable to reproduce this with either the latest npm (5.3.0), or the original reported one(s) (5.0.3, 5.0.4, 5.1.0) on my Windows installation. Tried every combo posted here, a few times. :\

@zkat zkat added the needs-repro label Jul 14, 2017

@gforceg

This comment has been minimized.

Copy link

commented Jul 14, 2017

Hi @zkat:

try running this:

git clone https://github.com/mgechev/angular-seed
cd angular-seed
npm i

The above works without issue for me when I am running npm 5.0.3, but there are multiple errors in 5.3.0.

Below is a my git-bash terminal output:

<USER>@localhost MINGW64 ~/src/my-stuff
$ npm --version
5.3.0
<USER>@localhost MINGW64 ~/src/my-stuff
$ node --version
v8.1.4

<USER>@localhost MINGW64 ~/src/my-stuff
$ git clone https://github.com/mgechev/angular-seed
Cloning into 'angular-seed'...
remote: Counting objects: 10055, done.
remote: Compressing objects: 100% (40/40), done.
remote: Total 10055 (delta 21), reused 32 (delta 11), pack-reused 10004
Receiving objects: 100% (10055/10055), 3.21 MiB | 1.95 MiB/s, done.
Resolving deltas: 100% (5902/5902), done.

<USER>@localhost MINGW64 ~/src/my-stuff
$ cd angular-seed/

<USER>@localhost MINGW64 ~/src/my-stuff/angular-seed (master)
$ npm i

> weak@1.0.1 install C:\Users\<USER>\src\my-stuff\angular-seed\node_modules\weak
> node-gyp rebuild


C:\Users\<USER>\src\my-stuff\angular-seed\node_modules\weak>if not defined npm_config_node_gyp (node "C:\Programs\APPS\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere.  [C:\Users\<USER>\src\my-stuff\angular-seed\node_modules\weak\build\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Programs\APPS\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Programs\\APPS\\nodejs\\node.exe" "C:\\Programs\\APPS\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\<USER>\src\my-stuff\angular-seed\node_modules\weak
gyp ERR! node -v v8.1.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

> node-sass@4.5.3 install C:\Users\<USER>\src\my-stuff\angular-seed\node_modules\node-sass
> node scripts/install.js

Cached binary found at C:\Programs\APPS\npm-cache\node-sass\4.5.3\win32-x64-57_binding.node

> node-sass@4.5.3 postinstall C:\Users\<USER>\src\my-stuff\angular-seed\node_modules\node-sass
> node scripts/build.js

Binary found at C:\Users\<USER>\src\my-stuff\angular-seed\node_modules\node-sass\vendor\win32-x64-57\binding.node
Testing binary
Binary is fine
npm ERR! path C:\Users\<USER>\src\my-stuff\angular-seed\node_modules\fsevents\node_modules
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall scandir
npm ERR! Error: EPERM: operation not permitted, scandir 'C:\Users\<USER>\src\my-stuff\angular-seed\node_modules\fsevents\node_modules'
npm ERR!  { Error: EPERM: operation not permitted, scandir 'C:\Users\<USER>\src\my-stuff\angular-seed\node_modules\fsevents\node_modules'
npm ERR!   stack: 'Error: EPERM: operation not permitted, scandir \'C:\\Users\\<USER>\\src\\my-stuff\\angular-seed\\node_modules\\fsevents\\node_modules\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'scandir',
npm ERR!   path: 'C:\\Users\\<USER>\\src\\my-stuff\\angular-seed\\node_modules\\fsevents\\node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
@gforceg

This comment has been minimized.

Copy link

commented Jul 14, 2017

I ran it a second time and it got a little further.

<USER>@localhost MINGW64 ~/src/my-stuff/angular-seed (master)
$ npm i

> weak@1.0.1 install C:\<USER>s\<USER>\src\my-stuff\angular-seed\node_modules\weak
> node-gyp rebuild


C:\<USER>s\<USER>\src\my-stuff\angular-seed\node_modules\weak>if not defined npm_config_node_gyp (node "C:\Programs\<USER>@localhost\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere.  [C:\<USER>s\<USER>\src\my-stuff\angular-seed\node_modules\weak\build\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Programs\<USER>@localhost\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Programs\\<USER>@localhost\\nodejs\\node.exe" "C:\\Programs\\<USER>@localhost\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\<USER>s\<USER>\src\my-stuff\angular-seed\node_modules\weak
gyp ERR! node -v v8.1.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

> node-sass@4.5.3 install C:\<USER>s\<USER>\src\my-stuff\angular-seed\node_modules\node-sass
> node scripts/install.js

Cached binary found at C:\Programs\<USER>@localhost\npm-cache\node-sass\4.5.3\win32-x64-57_binding.node

> node-sass@4.5.3 postinstall C:\<USER>s\<USER>\src\my-stuff\angular-seed\node_modules\node-sass
> node scripts/build.js

Binary found at C:\<USER>s\<USER>\src\my-stuff\angular-seed\node_modules\node-sass\vendor\win32-x64-57\binding.node
Testing binary
Binary is fine

> angular-seed@1.0.0 postinstall C:\<USER>s\<USER>\src\my-stuff\angular-seed
> gulp check.versions && gulp build.bundle.rxjs && npm prune && gulp webdriver && gulp print.banner

[15:14:33] Requiring external module ts-node/register
[15:14:41] Loading tasks folder C:\<USER>s\<USER>\src\my-stuff\angular-seed\tools\tasks\seed
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.assets.dev
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.assets.prod
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.bundle.rxjs
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.bundles.app.aot
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.bundles.app.rollup.aot
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.bundles.app
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.bundles
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.docs
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.html_css
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.index.dev
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.index.prod
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.js.dev
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.js.e2e
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.js.prod.aot
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.js.prod.rollup.aot
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.js.prod
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.js.test
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.tools
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\check.tools
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\check.versions
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\clean.all
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\clean.coverage
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\clean.dev
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\clean.e2e
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\clean.prod
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\clean.tools
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\clear.files
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\compile.ahead.prod
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\copy.prod.rollup.aot
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\copy.prod
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\e2e
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\generate.manifest
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\i18n.build
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\i18n.merge
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\karma.run
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\karma.run.without_coverage
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\karma.run.with_coverage
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\karma.watch
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\minify.bundles
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\minify.index
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\noop
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\print.banner
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\serve.coverage
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\serve.coverage.watch
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\serve.docs
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\server.prod
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\server.start
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\start.deving
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\sw.manifest.static
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\test.watch
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\transpile.bundles.rollup.aot
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\tslint
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\watch.dev
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\watch.e2e
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\watch.test
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\webdriver
[15:14:41] Loading tasks folder C:\<USER>s\<USER>\src\my-stuff\angular-seed\tools\tasks\project
[15:14:41] Registering task ~\src\my-stuff\angular-seed\tools\tasks\project\sample.task
[15:14:41] Using gulpfile ~\src\my-stuff\angular-seed\gulpfile.ts
[15:14:41] Starting 'check.versions'...
[15:14:41] Finished 'check.versions' after 242 ms
[15:17:53] Requiring external module ts-node/register
[15:17:54] Loading tasks folder C:\<USER>s\<USER>\src\my-stuff\angular-seed\tools\tasks\seed
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.assets.dev
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.assets.prod
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.bundle.rxjs
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.bundles.app.aot
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.bundles.app.rollup.aot
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.bundles.app
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.bundles
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.docs
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.html_css
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.index.dev
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.index.prod
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.js.dev
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.js.e2e
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.js.prod.aot
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.js.prod.rollup.aot
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.js.prod
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.js.test
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\build.tools
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\check.tools
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\check.versions
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\clean.all
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\clean.coverage
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\clean.dev
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\clean.e2e
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\clean.prod
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\clean.tools
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\clear.files
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\compile.ahead.prod
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\copy.prod.rollup.aot
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\copy.prod
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\e2e
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\generate.manifest
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\i18n.build
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\i18n.merge
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\karma.run
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\karma.run.without_coverage
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\karma.run.with_coverage
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\karma.watch
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\minify.bundles
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\minify.index
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\noop
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\print.banner
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\serve.coverage
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\serve.coverage.watch
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\serve.docs
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\server.prod
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\server.start
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\start.deving
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\sw.manifest.static
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\test.watch
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\transpile.bundles.rollup.aot
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\tslint
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\watch.dev
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\watch.e2e
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\watch.test
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\seed\webdriver
[15:17:54] Loading tasks folder C:\<USER>s\<USER>\src\my-stuff\angular-seed\tools\tasks\project
[15:17:54] Registering task ~\src\my-stuff\angular-seed\tools\tasks\project\sample.task
[15:17:54] Using gulpfile ~\src\my-stuff\angular-seed\gulpfile.ts
[15:17:54] Starting 'build.bundle.rxjs'...
[15:18:05] Finished 'build.bundle.rxjs' after 12 s
npm WARN @angular/compiler-cli@4.2.6 requires a peer of typescript@^2.0.2 but none was installed.
npm WARN @angular/tsc-wrapped@4.2.6 requires a peer of typescript@^2.1.5 but none was installed.
npm WARN tsickle@0.21.6 requires a peer of typescript@^2.1.0 but none was installed.
npm WARN gulp-typescript@3.1.7 requires a peer of typescript@~2.0.3 || >=2.0.0-dev || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev but none was installed.
npm WARN tslint@5.5.0 requires a peer of typescript@>=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev but none was installed.
npm WARN tsutils@2.6.0 requires a peer of typescript@>=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >= 2.4.0-dev || >= 2.5.0-dev || >= 2.6.0-dev but none was installed.

npm ERR! May not delete: C:\<USER>s\<USER>\src\my-stuff\angular-seed\node_modules\.bin

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Programs\<USER>@localhost\npm-cache\_logs\2017-07-14T21_18_18_363Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angular-seed@1.0.0 postinstall: `gulp check.versions && gulp build.bundle.rxjs && npm prune && gulp webdriver && gulp print.banner`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-seed@1.0.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
@zkat

This comment has been minimized.

Copy link
Member

commented Jul 14, 2017

guess I'll try this again. Probably not going to touch this this weekend 'cause I need a bit of a break, but thanks for putting together something else I can try <3 I'll take a look next week for sure

@gforceg

This comment has been minimized.

Copy link

commented Jul 14, 2017

I'm willing to bet this has something to do w/ McAfee OnAccess Scanner -- which is a requirement where I work. Never the less, the above works about 90% of the time in npm < npm5.2 - now I'm only having success about 10% of the time.

It seems like it's trying to scan or unlink a file that does not exist anymore.

@zkat

This comment has been minimized.

Copy link
Member

commented Jul 14, 2017

@gforceg I suspect your specific issue is a bit different from OP but it all seems to be in the same category.

One reason why npm@>=5.1.0 might be more prone to this is because npm started parallelizing installations in npm@5.1.0. So now there's 4-8 processes all hitting the filesystem and McAfee wants to cry.

@gforceg

This comment has been minimized.

Copy link

commented Jul 14, 2017

@zkat you're probably right. Now, I haven't run into this particular issue w/ yarn and I believe yarn also installs packages in parallel. Are there any flags I can pass to limit / prevent parallel installations?

e.g., npm i -j 2 or npm i --sync

(I much prefer npm over yarn for many reasons: publishing via npm is much cleaner thanks to .npmignore and npm has so much more CLI functionality.)

@kylelamse

This comment has been minimized.

Copy link
Author

commented Jul 14, 2017

@zkat @gforceg I am running into this issue on my work computer which does indeed have McAfee installed.
Edit: removed gist

@zkat

This comment has been minimized.

Copy link
Member

commented Jul 15, 2017

@gforceg idk. last I checked, yarn was still doing copies on a single thread, but that may have changed. There's also (currently) no mechanism for controlling npm's parallelism besides patching lib/install/actions/extract.js to try it out.

What surprises me about stuff like this is that we're using https://npm.im/graceful-fs to handle weird Windows filesystem behavior like this. Perhaps graceful-fs is missing something, or for some reason, graceful-fs isn't being used by the tar extractor, or something. I wish this error had an actual stack trace, 'cause I've no idea where it's actually coming from rn.

Are you able to at least ignore a path, with your McAfee install?

@gforceg

This comment has been minimized.

Copy link

commented Jul 15, 2017

@zkat

It seems like yarn may have similar issues.

Thanks for referencing that file. I'm going to take a look at that. 🤓

Are you able to at least ignore a path, with your McAfee install?

I wish. IMHO that's the real solution. I never have these sort of issues in Fedora. 🙄

@marcins marcins marked this as a duplicate of #17747 Jul 16, 2017

@marcins marcins referenced this issue Jul 16, 2017

Closed

Error: EPERM: operation not permitted, scandir #17747

2 of 13 tasks complete
@marcins

This comment has been minimized.

Copy link
Contributor

commented Jul 16, 2017

Interestingly we weren't seeing this issue when we first went from npm 5.0.3 to 5.1.0, however we recently did some work that involved adding approximately 20-30 packages to package.json (we consolidated multiple package.json files in our repo - long story) and since then we have been seeing this error in our CI builds that run on Windows. We will probably have to revert to npm 5.0.3 for now as well :(

@cchamberlain

This comment has been minimized.

Copy link

commented Jul 17, 2017

Also getting this issue on 5.2.0 / 5.3.0 but didn't notice on 5.0.3.

I'm noticing Windows Defender (MsMpEng.exe) jumping up to ~30%+ CPU usage during the install.

Workaround for me in the short-term is to use npm i --no-optional which bypasses fsevents altogether and never triggers the error. Wish there was a config option to always use --no-optional. 😿

One thing that seems a bit odd is if I delete package-lock.json and node_modules, then run npm i --no-optional I get a package-lock.json without fsevents throughout, yet it still attempts to install it anyways on successive runs of npm i.

@gforceg

This comment has been minimized.

Copy link

commented Jul 18, 2017

I haven't had a chance to mess w/ forcing sync yet. Will try this afternoon.

Off topic: package-lock.json behaves weirdly for me too. In 5.0.3 when I remove my node_modules directory and say 'npm install' some of my dependencies are not installed unless I delete package-lock.json and try again.

@cchamberlain

This comment has been minimized.

Copy link

commented Jul 18, 2017

@gforceg - re: the package-lock.json issue - are you sure the original package-lock.json (that you deleted) had the missing packages specified in it? My understanding is if the package-lock.json exists, it pretty much ignores package.json dependencies.

My debugging strategy for this is the following (replace react with your missing package):

  • npm -v
    • "What npm client do I have?"
  • cat package-lock.json | grep react
    • "Was the package installed originally via npm 5?"
    • Teammate may have installed with npm <5 | yarn, no lock file update, npm 5 clients now out of sync until lock file regenerated.
  • cat package.json | grep react
    • "Did some client (maybe not npm 5) install the package?"
  • npm ls react
    • What does npm think I have installed? Any errors?
  • npm dist-tag ls react
    • What's the current latest tag published to npm?
@paulthomas75

This comment has been minimized.

Copy link

commented Nov 15, 2017

I had this issue and it was to do with residual files for me. I ran npm cache clean --force and also deleted AppData\Roaming\npm-cache folder.

@HaulinOats

This comment has been minimized.

Copy link

commented Nov 20, 2017

OS: Windows 7 64 bit (Windows_NT x64 6.1.7601)

Upgrading to the newest version of NPM has consistently given me this error when trying to install/uninstall packages regardless of running the terminal as admin or not. Seems to fall on the 'fsevents' package at the 'osenv' functionality in particular (when looking at the debug logs) but not entirely sure.

Have temporarily fixed this issue by reverting to previous version of NPM 5.0.3 (running the following command) as mentioned by @bohoffi :

npm install -g npm@5.0.3

Error thrown when trying to install/uninstall any packages in newer versions of npm:

C:\Users\bdcon734\Documents\sampleblog>npm uninstall is-sorted --save
npm ERR! path C:\Users\bdcon734\Documents\sampleblog\node_modules\fsevents\node_modules
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall scandir
npm ERR! Error: EPERM: operation not permitted, scandir 'C:\Users\bdcon734\Documents\sampleblog\node_modules\fsevents\node_modules'
npm ERR! at Error (native)
npm ERR! { Error: EPERM: operation not permitted, scandir 'C:\Users\bdcon734\Documents\sampleblog\node_modules\fsevents\node_modules'
npm ERR! at Error (native)
npm ERR! stack: 'Error: EPERM: operation not permitted, scandir 'C:\Users\bdcon734\Documents\sampleblog\node_modules\fsevents\node_modules'\n at Error (native)',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'scandir',
npm ERR! path: 'C:\Users\bdcon734\Documents\sampleblog\node_modules\fsevents\node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\bdcon734\AppData\Roaming\npm-cache_logs\2017-11-20T17_24_03_901Z-debug.log

@bennettellis

This comment has been minimized.

Copy link

commented Nov 20, 2017

strangely has been working consistently since I upgraded to 5.5.1. Of note is that I did try clearing cache (forced) before doing that. Clearing the cache did NOT resolve the issue for previous version (can't recall what specific one I was on, but I try to keep current so not too old), It was only after upgrade that npm seems to be functioning normally. Maybe I just haven't encountered the problem (race condition) again and/or maybe it's a combination of the cleaning of the cache and the later release that significantly reduces the occurrence of the issue.

@Karasuni

This comment has been minimized.

Copy link

commented Nov 20, 2017

@paulthomas75 @brett84c @bennettellis @brett84c
It's a race condition and no 'fix' is available currently.

#19054 by @iarna will be merged but would only reduce the occurrence and not solve it. #19042 would solve it but was rejected.

I'm still running into this issue (and the subsequent delays) daily.

@HaulinOats

This comment has been minimized.

Copy link

commented Nov 20, 2017

@bennettellis It doesn't work for me when upgrading to 5.5.1 but it does when I revert to 5.0.3. Hoping for an actual fix so I can use the newest version(s) of npm.

@japer21

This comment has been minimized.

Copy link

commented Nov 21, 2017

npm install npm@5.3 -g
works like a charm. I downgraded and it works perfectly. I have spent lot of time figuring this out.
Windows 10 and the latest version of npm do not go along.

@leotm

This comment has been minimized.

Copy link

commented Nov 24, 2017

@japer21 npm install npm@5.3 -g didn't work.
@brett84c npm install npm@5.0.3 -g worked.

@elantion

This comment has been minimized.

Copy link

commented Nov 24, 2017

frustrating issue. Came out everyday and no clue how to fix this...

@japer21

This comment has been minimized.

Copy link

commented Nov 24, 2017

@ansballard

This comment has been minimized.

Copy link

commented Nov 27, 2017

Just going to add another comment since they keep getting lost. Installing different versions of npm does not fix the issue. The issue is caused by a race condition when removing dependencies asynchronously. There are multiple pull requests being worked on, and the core team is aware and involved. #19054 and #19042 are the pull requests mentioned above.

@amorenew

This comment has been minimized.

Copy link

commented Nov 28, 2017

latest npm 5.5.1 solved my problem

@ba55ie

This comment has been minimized.

Copy link

commented Nov 29, 2017

5.6.0 has been released. I haven't tested it yet, but it should contain the fix.

@elantion

This comment has been minimized.

Copy link

commented Nov 29, 2017

I have test it. It has been fixed! I can't hold my tear! Let's have beer tonight!

@HaulinOats

This comment has been minimized.

Copy link

commented Nov 29, 2017

Upgrade to 5.6.0 has fixed the issue for me as well! You guys/girls rock!!

@mcaden

This comment has been minimized.

Copy link

commented Nov 29, 2017

Confirmed it's working for me on 2 different machines, multiple projects.

On Windows 10 at least it's worth noting that if you're using 9.x (which I am on one machine) you may run into an issue where npm installed in AppData doesn't want to play nice with node 9 and update. You have to uninstall:

npm uninstall -g npm

Which will fall back to the one included in the nodejs install. Then you can install a new one:

npm install -g npm@5.6.0

@saip106

This comment has been minimized.

Copy link

commented Dec 1, 2017

I am neither able to uninstall npm 5.5.1 nor update npm to 3.6.0. Please help !!!

Here is the error I get:

npm ERR! path C:\Program Files\nodejs\npm.cmd
npm ERR! code EEXIST
npm ERR! Refusing to delete C:\Program Files\nodejs\npm.cmd: is outside C:\Program Files\nodejs\node_modules\npm and not a link
npm ERR! File exists: C:\Program Files\nodejs\npm.cmd
npm ERR! Move it away, and try again.
@ansballard

This comment has been minimized.

Copy link

commented Dec 1, 2017

@saip106 That's more than likely a separate issue, you'll want to do a little googling and open a new issue if you can't find a solution on your own.

@kylelamse

This comment has been minimized.

Copy link
Author

commented Dec 2, 2017

@zkat Why did this issue get automatically closed? Obviously it's still an issue because people have been commenting on it for 5 months.

@Mutasem-Halawani

This comment has been minimized.

Copy link

commented Dec 4, 2017

Fixed When I cleared cache ( npm cache verify ) - on npm 5.5.1

@leotm

This comment has been minimized.

Copy link

commented Dec 4, 2017

@mcaden Had to remove C:\Users\username\AppData\Roaming\npm\ too for fresh re-install

@gnicol-bzh

This comment has been minimized.

Copy link

commented Dec 6, 2017

Obviously... I'm not the first having this issue!

As a workaround, I closed Chrome and it worked. Or sometime I close Windows Explorer... It looks like a background process is preventing npm from doing the job... A full fresh install seems to be good too.

npm ERR! path D:\github\xxx\node_modules\fsevents\node_modules\rc\node_modules
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall lstat
npm ERR! Error: EPERM: operation not permitted, lstat 'D:\github\xxx\node_modules\fsevents\node_modules\rc\node_modules'
npm ERR!  { Error: EPERM: operation not permitted, lstat 'D:\github\xxx\node_modules\fsevents\node_modules\rc\node_modules'
npm ERR!   stack: 'Error: EPERM: operation not permitted, lstat \'D:\\\github\\xxx\\node_modules\\fsevents\\node_modules\\rc\\node_modules\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'lstat',
npm ERR!   path: 'D:\\\github\\xxx\\node_modules\\fsevents\\node_modules\\rc\\node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

EDIT: NPM version : 5.5.1.
... installing npm 5.6.0
... installing node module
... done!

I hope the problem is solved! ;)

@ansballard

This comment has been minimized.

Copy link

commented Dec 6, 2017

At this point this issue should be resolved with npm@5.6.0, and further comments are mostly how to reinstall npm. Can any NPM members confirm, lock this issue, and redirect to new issues? At this point I'm just hopping in here every couple days to post the same thing so it doesn't get lost, since at this point people shouldn't have to take the half hour to read through the entire thread.

Speaking of that, this issues seems to be resolved with a clean install of npm@5.6.0. If you have fully uninstalled and reinstalled,and npm --version returns 5.6.0, and you're still having this issue, you should definitely leave a comment, but otherwise it's just noise. Clearing the cache, downgrading, installing on an ssd, etc do not fix the issue, it just makes it less likely since the problem is a race condition at dependency uninstall time.

@aciccarello

This comment has been minimized.

Copy link

commented Dec 6, 2017

I personally have not faced any issues since updating to npm@5.6.0 but in #19054 @Cito noted a few improvements that could be made to make the fix more robust.

@zkat

This comment has been minimized.

Copy link
Member

commented Dec 8, 2017

Closing this, since things are probably nicely resolved, as @ansballard points out -- we'll be doing further improvements, as @aciccarello says, but those are beyond the scope of this PR.

So, I'm gonna lock it. Please make a new one if this turns out to not actually be fixed.

@npm npm locked and limited conversation to collaborators Dec 8, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.