There is the following problem - I installed all modules and I'm trying to make npm-shrinkwrap.json file:
npm shrinkwrap
But I always get the following error:
npm ERR! Darwin 14.3.0
npm ERR! argv "/usr/local/Cellar/node/4.1.2/bin/node" "/usr/local/bin/npm" "shrinkwrap"
npm ERR! node v4.1.2
npm ERR! npm v2.10.1
npm ERR! Problems were encountered
npm ERR! Please correct and try again.
npm ERR! extraneous: [email protected] /Users/ulnda/projects/folder/node_modules/my-module/node_modules/webdriverio/node_modules/core-js
npm ERR! extraneous: [email protected] /Users/ulnda/projects/folder/node_modules/core-js
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /Users/ulnda/projects/folder/npm-debug.log
What does it mean? How can I fix it? Thanks in advance!
To resolve extraneous errors in the npm list output, you need to add the packages in your package. json file. Once the upgrade is done, run the npm list command again to see if the extraneous error is still there. Then run the npm install command to install the dependencies again.
npm ERR! extraneous means a package is installed but is not listed in your project's package. json . Since you're listing packages that have been installed globally, it's going to give you a lot of extraneous errors that can be simply ignored because most things installed globally will not be in your project's package.
NPM shrinkwrap is used to lock the dependency version in a project. After installing packages using npm install or npm install package-name and updating your node_modules folder, you should run npm shrinkwrap. It will create new npm-shrinkwrap.
This command repurposes package-lock. json into a publishable npm-shrinkwrap. json or simply creates a new one. The file created and updated by this command will then take precedence over any other existing or future package-lock.
Try npm prune
before shrinkwrapping.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With