0
votes

npm install outputs the following warning:

npm WARN [email protected] requires a peer of npm@>=3.10.8 but none is installed. You must install peer dependencies yourself.

npm -v outputs 5.5.1

Why is npm complaining about the missing peer dependency?

This question isn't a duplicate of What's the difference between dependencies, devDependencies and peerDependencies in npm package.json file?. That question doesn't even mention engines and doesn't explain that peerDependencies are not searched among global packages.

1

1 Answers

0
votes

Peer dependencies are not searched among global packages (https://github.com/npm/npm/issues/9857). npm should be installed locally for the peer dependency to be satisfied.

In this case, if the nswag package does not need the npm package installed locally, it should list it in engines instead of in peerDependencies.