【发布时间】:2020-08-11 07:04:11
【问题描述】:
我的package.json 中有以下脚本定义“debug-windows”:
{
"scripts": {
"debug-windows": "$env:NODE_ENV=\"dev\"; node src/dequeue.js"
}
}
我使用 npm run debug-windows 运行,我得到了错误:
> servicebus-timeout@1.0.0 debug-windows C:\myapp
> $env:NODE_ENV="dev"; node src/dequeue.js
The filename, directory name, or volume label syntax is incorrect.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! servicebus-timeout@1.0.0 debug-windows-test: `$env:NODE_ENV="dev"; node src/dequeue.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the servicebus-timeout@1.0.0 debug-windows-test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\<USERNAME>\AppData\Roaming\npm-cache\_logs\2020-04-27T16_29_32_585Z-debug.log
如果我直接在 PowerShell 上运行相同的命令,它会成功:
PS C:\myapp> $env:NODE_ENV="dev"; node src/dequeue.js
Waiting for messages: Mon Apr 27 2020 13:24:06 GMT-0300 (Brasilia Standard Time)
【问题讨论】:
标签: node.js powershell npm