npm Cheatsheet
1. Install npm package
npm install jquery --save
2. Update an npm package
npm update jquery --save
3. Remove a package
npm uninstall jquery --save
4. Install the specified version of the npm package
npm install jquery@2.2.4 --save
5. npm update to latest
npm install npm@latest -g
6. npm downgrade version
npm install npm@4 -g
7. Quickly delete node_modules
npm install rimraf -g
rimraf node_modules
8. Error: Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 8.x How to deal with it?
npm rebuild node-sass
npm update
9. Error: npm ERR! Error: EPERM: operation not permitted, rename how to deal with it?
Run cmd in administrator mode
10. Use Taobao Mirror
- Temporary use
npm --registry https://registry.npm.taobao.org install koa
- Long-lasting use
npm config set registry https://registry.npm.taobao.org
- Via cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
11. Use official mirrors
npm config set registry https://registry.npmjs.org/
12. View npm source address
npm config get registry