npm

show npm configuration
npm config list
npm config ls -l -> to show all defaults

outdated packages
list outdated packages
npm outdated -g --depth=0
update packages named n respectivelly npm
sudo npm update -g n npm

show npm cache data directory
npm config get cache

npm cache list, clean
npm cache ls
npm cache clean

print golbal npm path
npm root -g
/usr/local/lib/node_modules
npm --help
... npm@4.0.5 /usr/local/lib/node_modules/npm

list local node modules (project/node_modules)
npm ls --depth=0

list global node modules (/usr/lib/node_modules)
showing install paths
npm ls -gp --depth=0
showing install version
npm ls -g --depth=0

install global package, specific version
sudo npm install -g webpack@2.2.0-rc.4

uninstall global package (don't specify the version)
sudo npm uninstall -g -verbose webpack-dev-server

https://npmsearch.com/
https://docs.npmjs.com/cli/search
npm search angular-in-memory-web-api

show the dependencies of the typings package at version 1.4.0 (or just check its package.json file)
npm view typings@1.4.0 dependencies

repair the npm cache
npm cache verify

ERROR
	npm WARN retry will retry, error on last attempt: Error: certificate has expired
	npm ERR! code CERT_HAS_EXPIRED
SOLUTION
	npm config set strict-ssl false

COMMAND
	sudo npm install -g node-sass@^4.0.0
ERROR
	Unable to save binary /usr/local/lib/node_modules/node-sass/vendor/linux-x64-51 : { Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/node-sass/vendor
SOLUTION
	sudo npm install -g node-sass@^4.0.0 --unsafe-perm=true --allow-root

details about the package
npm info openlayers

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.