嘗試從Webstorm內部調試NPM腳本。應用程序通過NPM腳本運行,但是在調試腳本時它總是崩潰。我知道有國旗$NODE_DEBUG_OPTION
,但補充說,似乎並不奏效。Webstorm通過IDE調試NPM腳本
腳本:
"dev": "npm run dev:server & npm run build:client:watch",
"dev:server": "npm run build:server:watch & nodemon --harmony lib/server",
"build:client:watch": "WEBPACK_DEV=true NODE_ENV=development STACK=local node lib/server/webpack",
"build:server:watch": "npm run transpile:watch -- -d lib/common src/common & npm run transpile:watch -- -d lib/server src/server",
"transpile": "BABEL_ENV=node babel",
"transpile:watch": "npm run transpile -- --watch",
根據Webstorm:To debug the "dev" script, make sure the $NODE_DEBUG_OPTION string is specified as the first argument for the node command you'd like to debug. For example: { "start": "node $NODE_DEBUG_OPTION server.js" }
但在不同的地方添加此,即使它仍然會給我一個錯誤。有什麼建議麼?
感謝您的建議。我沒有讀過,也沒有研究,但我運行v6.11.0,所以它不適用於我 – Jmrapp
@Jmrapp我一開始並沒有注意到你有不同的寫這個Const NODE_DEBUG_OPTION,我總是使用這個%NODE_DEBUG_OPTION%就像Webstorm告訴我,它適用於nodejs 6,您使用的是什麼Webstorm版本?你究竟得到了什麼錯誤? –
我在Mac上運行,而不是Windows,並且正在研究它似乎常量的windows版本是%NODE_DEBUG_OPTION%,而mac版本是$ NODE_DEBUG_OPTION。 Webstorm特別告訴我在調試應用程序 – Jmrapp