相关疑难解决方法(0)

运行并行Shell Node.js脚本时出现问题

在我的package.json文件中,我具有以下脚本:

"scripts": {
    "start": "npm run watch:all",
    "test": "echo \"Error: no test specified\" && exit 1",
    "lite": "lite-server",
    "sass": "node-sass -o sass/ css/",
    "watch:sass": "onchange 'sass/*.scss' -- npm run sass",
    "watch:all": "parallelshell 'npm run watch:sass' 'npm run lite'"
  }
Run Code Online (Sandbox Code Playgroud)

每当我运行代码时,我都会收到以下错误消息:

 crs@1.0.0 start /home/hazem/crs
> npm run watch:all


> crs@1.0.0 watch:all /home/hazem/crs
> parallelshell 'npm run watch:sass' 'npm run lite'

child_process.js:422
    throw new ERR_INVALID_ARG_TYPE('options.cwd', 'string', options.cwd);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "options.cwd" property must be of type string. Received type function
    at …
Run Code Online (Sandbox Code Playgroud)

json sass node.js lite-server npm-scripts

2
推荐指数
1
解决办法
984
查看次数

标签 统计

json ×1

lite-server ×1

node.js ×1

npm-scripts ×1

sass ×1