我正在学习Node并正在研究具有以下构建脚本的现有项目:
"build": "npm run clean && ./node_modules/.bin/webpack --env=production --progress --profile --colors --display-optimization-bailout"
我按照指令执行了npm install
,但是build命令在下面给出了一个错误:
$ npm run build
> npm run clean && ./node_modules/.bin/webpack --env=development --progress --profile --colors --display-optimization-bailout
> rimraf build
'.' is not recognized as an internal or external command,
operable program or batch file.
关于在Windows PC上可能丢失的内容以及如何解决该问题的任何想法。谢谢!
将JSON中的webpack
路径转义为双引号,即\"...\"
。
例如:
"build": "npm run clean && \"./node_modules/.bin/webpack\" --env=production --progress --profile --colors --display-optimization-bailout"
^^ ^^