Windows等价于package.json脚本命令

时间:2019-07-09 12:12:23

标签: npm node-modules package.json parcel

我正在使用包裹,并希望清理.cache文件夹,并在3000上运行React前端,同时在1234上运行后端。这些是我的启动脚本。

"scripts": {
    "test": "jest --watchAll",
    "start": "npm run build-client && node index.js",
    "dev": "npm run dev-client & nodemon index.js",
    "dev-peer": "cross-env GENERATE_PEER_PORT='true' nodemon index.js",
    "build-client": "npm run clean && parcel build client/src/index.html --out-dir client/dist",
    "dev-client": "npm run clean && parcel client/src/index.html --out-dir client/dist",
    "clean": "rmdir /s/q .cache client/dist"
  },

我已经使用rmdir /s/q将Windows命令放在“干净”脚本上,但是得到了

Invalid switch - "dist".
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ajax27-blockchain@1.0.0 clean: `rmdir /s/q .cache client/dist`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ajax27-blockchain@1.0.0 clean 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\shaun\AppData\Roaming\npm-cache\_logs\2019-07-09T11_49_08_194Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ajax27-blockchain@1.0.0 dev-client: `npm run clean && parcel client/src/index.html --out-dir client/dist`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ajax27-blockchain@1.0.0 dev-client 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\shaun\AppData\Roaming\npm-cache\_logs\2019-07-09T11_49_08_223Z-debug.log

1 个答案:

答案 0 :(得分:0)

您也可以使用rimraf npm模块,它也可以在Windows上很好地工作。

相关问题