npm
命令
1 2 3 4 5
| npm install -save koajs
npm install -g koajs
|
设置某一次安装源
1
| npm install -g npm --registry=https://registry.npm.taobao.org
|
安装cnpm
1
| npm install --registry=http://r.cnpmjs.org -g cnpm
|
更新最新版本nodejs
1 2 3 4
| sudo npm install -g n n latest
|
nodejs chrome调试工具 node-inspector
1 2 3 4 5 6 7 8 9 10 11
|
npm install -g node-inspector
node --debug=12345 index.js
node-inspector --web-port 4000 --debug-port 12345
|
子进程
1 2 3 4 5 6 7
| let cp=require('child_process') let curdir = '/opt/do/hexo' let cmd1 = `cd ${curdir};` let cmd2 = `git pull;` cp.exec(cmd1 + cmd2, function(err,stdout){ console.log(stdout) })
|