-
Notifications
You must be signed in to change notification settings - Fork 3k
npm gets permissions of node_modules all wrong #16766
Description
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 installing modules in a freshly cloned git repo using npm install on npm version 5.0.0, I get the weird behavior of the node_modules folder having the wrong owner. Using ls -la I can see the following info is returned:
drwxr-xr-x 372 502 dialout 12288 May 28 11:16 node_modules/
When starting the application, I get several dependency errors. When installing the dependency that is reported to be missing, another entry appears.
When doing the same using npm at version 4.6.1, I get the following output:
drwxr-xr-x 373 root root 12288 May 28 11:19 node_modules/
Which is expected behavior, and no packages are missing
Note: The missing dependencies seem to be devDependencies from a few of the packages I depend on. There is something mentioned in the Breaking changes section of the NPM update changelog, but not about these packages not being installed when running npm install
How can the CLI team reproduce the problem?
npm install -g [email protected]
cd /path/to/your/repo
npm install
ls -la
There is no npm-debug.log file, as there are no errors reported.
I'm positive I'm running npm as root:root.
root@node1:~# whoami
root
root@node1:~# groups
root
supporting information:
npm -vprints:5.0.0node -vprints:v7.10.0npm config get registryprints:https://registry.npmjs.org/- Windows, OS X/macOS, or Linux?:
Ubuntu 16.04 LTS - Network issues:
- Geographic location where npm was run:
OVH, France - I use a proxy to connect to the npm registry.
- I use a proxy to connect to the web.
- I use a proxy when downloading Git repos.
- I access the npm registry via a VPN
- I don't use a proxy, but have limited or unreliable internet access.
- Geographic location where npm was run:
- Container:
- I develop using Vagrant on Windows.
- I develop using Vagrant on OS X or Linux.
- I develop / deploy using Docker.
- I deploy to a PaaS (Triton, Heroku).