Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] issue installing dependency when specified in both dev & peer #1998

Closed
mjeanroy opened this issue Oct 20, 2020 · 4 comments
Closed

[BUG] issue installing dependency when specified in both dev & peer #1998

mjeanroy opened this issue Oct 20, 2020 · 4 comments
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release

Comments

@mjeanroy
Copy link
Contributor

Current Behavior:

When a dependency is specified as a devDependency and as a peerDependency, it is not installed. I tested it with [email protected], everything worked well with npm < 7.

Expected Behavior:

I expect that all dev dependencies should be installed.

Steps To Reproduce:

I created a very small repository to reproduce the issue, so you can just checkout it and install dependencies:

git clone [email protected]:mjeanroy/npm-7-bug-peer-dev.git
cd npm-7-bug-peer-dev
npm install

Environment:

  • OS: MacOS 10.15.7
  • Node: 15.0.0
  • npm: 7.0.2
@mjeanroy mjeanroy added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Oct 20, 2020
@darcyclarke darcyclarke changed the title [BUG] <title> [BUG] issue installing dependency when specified in both dev & peer Oct 20, 2020
@darcyclarke darcyclarke removed the Needs Triage needs review for next steps label Oct 20, 2020
@isaacs
Copy link
Contributor

isaacs commented Oct 21, 2020

This appears to be working as of npm 7.0.3 and 7.0.2. I get the same results in each.

$ git clone [email protected]:mjeanroy/npm-7-bug-peer-dev.git
Cloning into 'npm-7-bug-peer-dev'...
Krypton ▶ Requesting SSH authentication from phone
Krypton ▶ Success. Request Allowed ✔
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 4 (delta 0), pack-reused 0
Receiving objects: 100% (4/4), done.

$  cd npm-7-bug-peer-dev
/Users/isaacs/dev/npm/arborist/npm-7-bug-peer-dev

$ npm install

added 6 packages, and audited 6 packages in 658ms

found 0 vulnerabilities

$ npm ls react
[email protected] /Users/isaacs/dev/npm/arborist/npm-7-bug-peer-dev
└── [email protected]


$ ls -laF node_modules/react/package.json
-rw-r--r--  1 isaacs  staff  882 Oct 26  1985 node_modules/react/package.json

Is it possible that --omit=peer or --omit=dev is set on your system, or --legacy-peer-deps?

@isaacs isaacs closed this as completed Oct 21, 2020
@lpinca
Copy link
Contributor

lpinca commented Oct 22, 2020

@isaacs it does not work with [email protected] shipped with Node.js v15.0.0.

$ node -v
v15.0.0
$ npm -v
7.0.2
$ git clone [email protected]:websockets/ws.git
Cloning into 'ws'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 14388 (delta 1), reused 5 (delta 0), pack-reused 14379
Receiving objects: 100% (14388/14388), 10.67 MiB | 1.77 MiB/s, done.
Resolving deltas: 100% (11784/11784), done.
$ cd ws
$ npm i
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

added 352 packages, and audited 352 packages in 16s

33 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
$ npm ls utf-8-validate
[email protected] C:\Users\luigi\Desktop\ws
└── (empty)

utf-8-validate is a dev dependency and an optional peer dependency.

@lpinca
Copy link
Contributor

lpinca commented Oct 22, 2020

The same happens with Node.js v15.0.1 and [email protected].

@mjeanroy
Copy link
Contributor Author

@isaacs You're right, I had omit=peer in my ~/.npmrc, I did not see that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

4 participants