I was trying to install phantomjs in order to make test
Twitter Bootstrap. After I had installed it locally i.e. npm install phantomjs
, it reported that the package was extraneous.
├─┬ [email protected] extraneous │ ├── [email protected] ... npm ERR! extraneous: [email protected] /Users/admin/bootstrap/node_modules/phantomjs npm ERR! not ok code 0
However, when phantomjs was installed globally i.e. npm install phantomjs -g
, it worked fine i.e. no extraneous error reported.
Questions:
Extraneous packages are those present in the node_modules folder that are not listed as any package's dependency list. If the --production flag is specified or the NODE_ENV environment variable is set to production , this command will remove the packages specified in your devDependencies .
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.
Installing the local dependencies means the module will be available only for a project you installed in the same directory. Global installing dependencies puts the module into your Node.
Description. This command removes "extraneous" packages. If a package name is provided, then only packages matching one of the supplied names are removed.
npm install
wont install phantom.js again.) (Btw.: npm install xxx --save
will automatically add xxx to the package.json)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