Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

npm gets permissions of node_modules all wrong #16766

@Cyberuben

Description

@Cyberuben

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 -v prints: 5.0.0
  • node -v prints: v7.10.0
  • npm config get registry prints: 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.
  • 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions