0%

npm技法总结

npm

作为前端的优秀包管理工具,记录一下

shell命令

install

force

将所有的包重新安装,太多包的话很危险,慎用

运行script

若有package.json

1
2
3
4
5
6
7
8
"scripts": {
"clean": "hexo clean",
"deploy": "hexo deploy",
"server": "hexo server",
"build": "hexo generate && node gittalk-auto-init.js",
"talk": "node gittalk-auto-init.js",
"merge": "cd python && python app.py"
},

npm run merge 运行对应的代码

npm设置源

npm config set registry https://registry.npmmirror.com

参考文献

node安装

官网下载源码,解压

ln -s /app/software/nodejs/bin/npm /usr/local/bin/

ln -s /app/software/nodejs/bin/node /usr/local/bin/