Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

any solution for the following error that appeared after installing onchange and parallelshell node_modules?

Tags:

node.js

npm

after installing the onchange and parallelshell packages for node.js by typing the following command in the node terminal

npm install --save-dev [email protected] [email protected]

and configure the package.json file as follow to be able to use the two scripts

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

and when typing 'npm start' to run, i face the following error and cannot solve it. so help me if u can please!

The Error :

[email protected] start D:\programming materials\coursera courses\web and mobile dev specialization\course 1\module 1\bootstrap exercise\assignment 1\Bootstrap4\conFusion npm run watch:all

[email protected] watch:all D:\programming materials\coursera courses\web and mobile dev specialization\course 1\module 1\bootstrap exercise\assignment 1\Bootstrap4\conFusion parallelshell "npm run watch:scss" "npm run lite"

child_process.js:420 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 normalizeSpawnArguments (child_process.js:420:11) at spawn (child_process.js:522:38) at D:\programming materials\coursera courses\web and mobile dev specialization\course 1\module 1\bootstrap exercise\assignment 1\Bootstrap4\conFusion\node_modules\parallelshell\index.js:104:17 at Array.forEach () at Object. (D:\programming materials\coursera courses\web and mobile dev specialization\course 1\module 1\bootstrap exercise\assignment 1\Bootstrap4\conFusion\node_modules\parallelshell\index.js:100:6) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] watch:all: parallelshell "npm run watch:scss" "npm run lite" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] watch:all 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\MISR COMP\AppData\Roaming\npm-cache_logs\2018-07-30T15_48_55_679Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] start: npm run watch:all npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start 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\MISR COMP\AppData\Roaming\npm-cache_logs\2018-07-30T15_48_55_778Z-debug.log

like image 429
Apdo Elsaed Avatar asked Jul 30 '18 16:07

Apdo Elsaed


2 Answers

I have had the same problem as you. We are probably doing the same course. Apparently, is a problem with version 3.0.2 of parallelshell. You just have to downgrade to version 3.0.1 and you will not have any more problems:

npm install --save-dev [email protected]
like image 67
pgarriga Avatar answered Nov 17 '22 11:11

pgarriga


Downgrade the version of parallelshell to 3.0.1 by typing npm install --save-dev [email protected]

Then type npm start And it works!!

like image 5
Anshika Jain Avatar answered Nov 17 '22 09:11

Anshika Jain