节点 js 构建问题并出现错误“'。'不被认可”

node js build problem with an error "'.' is not recognized"

我正在学习 Node 并正在处理一个现有项目,该项目具有如下构建脚本:

"build": "npm run clean && ./node_modules/.bin/webpack --env=production --progress --profile --colors --display-optimization-bailout"

我按照说明做了 npm install,但是构建命令给出了以下错误:

$ 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 电脑上。谢谢!

webpack 的路径用 JSON 转义双引号括起来,即 \"...\".

例如:

"build": "npm run clean && \"./node_modules/.bin/webpack\" --env=production --progress --profile --colors --display-optimization-bailout"
                           ^^                           ^^