Open onvno opened 5 years ago
Debugging Node.js with Chrome DevTools
执行
▸ node --inspect index.js
# Break on the first statement of the script with --inspect-brk
▸ node --inspect-brk index.js
调试
chrome://inspect
$ wget https://nodejs.org/dist/v10.16.3/node-v10.16.3-linux-x64.tar.xz
VERSION=v10.16.3
DISTRO=linux-x64
$ sudo mkdir -p /usr/local/lib/nodejs
$ sudo tar -xJvf node-$VERSION-$DISTRO.tar.xz -C /usr/local/lib/nodejs
3.更改配置文件 Set the environment variable ~/.profile, add below to the end
# Nodejs
VERSION=v10.16.3
DISTRO=linux-x64
export PATH=/usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin:$PATH
刷新配置文件
$ . ~/.profile
测试版本
$ node -v
$ npm version
$ npx -v
To create a sudo link:
sudo ln -s /usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin/node /usr/bin/node
sudo ln -s /usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin/npm /usr/bin/npm
sudo ln -s /usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin/npx /usr/bin/npx
具体安装部分见:Installation官方文档
babelnode - https://www.kancloud.cn/digest/babel/217106
npx 使用教程 - http://www.ruanyifeng.com/blog/2019/02/npx.html
koa-router:https://github.com/ZijianHe/koa-router bodyParser:https://github.com/koajs/bodyparser