Skip to content

[BUG] npm v6 windows install with prefix #3887

Closed
@Xesenix

Description

@Xesenix

As I didn't find an existing issue for this problem here is its description:

Current behavior

When running npm i --prefix project on Windows with node 14 and npm 6.14 install results in a lot of files created inside the project path. This problem doesn't appear on MAC or Linux versions or on Windows node 15 npm 7

Log after running command:

root\project\is-docker -> root\project\node_modules\is-docker\cli.js
root\project\mkdirp -> root\project\node_modules\mkdirp\bin\cmd.js
root\project\nopt -> root\project\node_modules\nopt\bin\nopt.js
root\project\installed-package-contents -> root\project\node_modules\@npmcli\installed-package-contents\index.js
root\project\sshpk-conv -> root\project\node_modules\sshpk\bin\sshpk-conv
root\project\sshpk-sign -> root\project\node_modules\sshpk\bin\sshpk-sign
...

Results in a lot of files where they shouldn't be:
obraz

Expected behavior

I assume those installed files should be inside project/node_modules/.bin but I am not sure about it.

Steps To Reproduce:

  1. create folder structure:
root
- project
  1. run npm init on root and root/project
  2. add some dependencies in project for example npm i @angular/cli
  3. remove node_modules - simulate as the whole project would be cloned from the repository
  4. try running npm i --prefix project from root folder

Environment

  • OS: Windows 10
  • Node: 14.17.4
  • npm: 6.14.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    Release 6.xwork is associated with a specific npm 6 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions