如何用`npm start`为我的应用程序使用node-inspector?
我正在使用npm start
来启动我的MEAN栈应用程序,但是我想使用node-inspector来debugging一些Mongoose。 我知道我可以用节点检查器启动节点检查器,但是我可以用node --debug app.js
来替代node --debug app.js
node-inspector
来使npm start
在我的情况下工作?
这是我的MEAN堆栈目录结构:
HTML views/ Angular.js public/javascript/ Express.js routes/ Node.js app.js Mongoose js models/, connected in app.js Mongo db connected in app.js
欲了解更多信息,这是我有关的问题 。
您可能想要将一个单独的debug
脚本添加到package.json
。 这样,当你完成debugging时,你将不必记得恢复npm start
。
"scripts": { "start": "node ./bin/www", "debug": "node --debug ./bin/www" }
从npm run
开始npm run
:
$ npm run debug
在package.json
修改start
运行命令:
"scripts": { "start": "node --debug app.js" }
我这样使用它,我也设置了一个variables,并在一个命令中运行检查器: npm run debug
"scripts": { "start": "set SOAPAPI=https://example.com/&&nodemon", "debug": "start node-inspector --web-port=8081&&set SOAPAPI=https://example.com/&&nodemon --debug" }
* nodemon是节点的实用程序包装,您可以改为使用node
- C ++和JS程序之间的共享内存
- 试图使hmac-sha256与Powershell for Canvas API一起工作
- 如何转换00B0(度标志)Unicode字符?
- 如何在Node Webkit桌面应用程序中使用Google Analytics
- 在Node.js中stream式传输video的一部分
- Node.js <Class>不是一个构造函数
- 在while循环中的socket.emit
- response.writeHead()方法中{'Content-Type:':'text / plain'}的数据types是什么?
- Node.js https.get或https.request中的Kerberos身份validation