LoginSignup
33
27

More than 5 years have passed since last update.

Windowsのnpm installでfsevents系のパーミッションエラー

Last updated at Posted at 2017-09-06

npm install時にパーミッション系のエラーが出たらnpm cache clearしろというエントリーが多いのでしばらくはまってしまいました。このパターンはnpm cache clearでは治りません。同じエラーではまってる人の助けになればと思い書きます。

fsevents系でnpm cache clearで治らなかった場合はこれでうまくいくと思います。

結論からいうとnpmのバージョンを5.0.3にしてください。

npm install -g npm@5.0.3

この辺で見つけました。
https://github.com/npm/npm/issues/17671#issuecomment-317879697

色々してるうちに自分の出したエラーがなくなったので上記のページのエラーを貼っておきます。

npm ERR! path C:\Users\ltheisen\git\caasd-event-analyzer-parent\event-analyzer-web2\node_modules\fsevents\node_modules\dashdash\node_modules
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall scandir
npm ERR! Error: EPERM: operation not permitted, scandir 'C:\Users\ltheisen\git\caasd-event-analyzer-parent\event-analyzer-web2\node_modules\fsevents\node_modules\dashdash\node
'
npm ERR!  { Error: EPERM: operation not permitted, scandir 'C:\Users\ltheisen\git\caasd-event-analyzer-parent\event-analyzer-web2\node_modules\fsevents\node_modules\dashdash\n
les'
npm ERR!   stack: 'Error: EPERM: operation not permitted, scandir \'C:\\Users\\ltheisen\\git\\caasd-event-analyzer-parent\\event-analyzer-web2\\node_modules\\fsevents\\node_mo
ashdash\\node_modules\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'scandir',
npm ERR!   path: 'C:\\Users\\ltheisen\\git\\caasd-event-analyzer-parent\\event-analyzer-web2\\node_modules\\fsevents\\node_modules\\dashdash\\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\ltheisen\AppData\Roaming\npm-cache\_logs\2017-07-25T21_09_00_506Z-debug.log

fseventsはMACのネイティブなAPIにアクセスするためのnpmモジュールのようですね。詳しくは調べてませんがその辺が原因で失敗するようです。

fseventsを自分で使ってなくてもインストールしたモジュールが使ってると出るようです。

33
27
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
33
27