Level 65
It's best not to use sudo for npm.
https://docs.npmjs.com/getting-started/fixing-npm-permissions
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
so i just started a new laravel 5.4 project. using Homestead on windows 10: When it comes to running npm install I run this command:
sudo npm install --no-bin-links
get the following error:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! path /home/vagrant/Code/metro/node_modules/.staging/lower-case-9ab641d1
npm ERR! code EPERM
npm ERR! errno -1
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename '/home/vagrant/Code/metro/node_modules/.staging/lower-case-9ab641d1' -> '/home/vagrant/Code/metro/node_modules/lower-case'
npm ERR! at destStatted (/usr/lib/node_modules/npm/lib/install/action/finalize.js:29:7)
npm ERR! at /usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:284:29
npm ERR! at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename '/home/vagrant/Code/metro/node_modules/.staging/lower-case-9ab641d1' -> '/home/vagrant/Code/metro/node_modules/lower-case'
npm ERR! at Error (native)
npm ERR! Error: EPERM: operation not permitted, rename '/home/vagrant/Code/metro/node_modules/.staging/lower-case-9ab641d1' -> '/home/vagrant/Code/metro/node_modules/lower-case'
npm ERR! at destStatted (/usr/lib/node_modules/npm/lib/install/action/finalize.js:29:7)
npm ERR! at /usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:284:29
npm ERR! at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename '/home/vagrant/Code/metro/node_modules/.staging/lower-case-9ab641d1' -> '/home/vagrant/Code/metro/node_modules/lower-case'
npm ERR! at Error (native)
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! /home/vagrant/.npm/_logs/2017-03-22T12_53_42_094Z-debug.log
It's best not to use sudo for npm.
https://docs.npmjs.com/getting-started/fixing-npm-permissions
Please or to participate in this conversation.