any solution for the following error that appeared after installing onchange and parallelshell node_modules? - node.js

after installing the onchange and parallelshell packages for node.js by typing the following command in the node terminal
npm install --save-dev onchange#3.3.0 parallelshell#3.0.2
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 :
confusion#1.0.0 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
confusion#1.0.0 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! confusion#1.0.0 watch:all: parallelshell "npm run watch:scss" "npm run lite"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the confusion#1.0.0 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! confusion#1.0.0 start: npm run watch:all
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the confusion#1.0.0 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

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 parallelshell#3.0.1

Downgrade the version of parallelshell to 3.0.1 by typing
npm install --save-dev parallelshell#3.0.1
Then type
npm start
And it works!!

Apparently we are doing the same course. So follow the below-mentioned way--
To install two NPM packages onchange and parallelshell use the downgraded version of parallel shell instead of 3.0.2 us 3.0.1:
npm install --save-dev onchange#3.3.0 parallelshell#3.0.1

give space between -- and npm
"watch:scss":"onchange \"css/*.scss\" -- npm run scss"
this will end first error
for parallelshell problem
do this copy content of index.js file from given link
https://raw.githubusercontent.com/darkguy2008/parallelshell/master/index.js
and paste it in your index.file at /project/node_modules/parallelshell/index.js
this will work.

First Un-Install all versions of parallelshell.
npm uninstall --save-dev parallelshell
Second Install parallelshell#3.0.1:
npm install --save-dev parallelshell#3.0.1
Third run start:
npm run start

Related

Trying Laravel jetstream but getting an error on "npm run dev"

lam getting the error below while running npm run dev
[webpack-cli] TypeError: this.program.configureOutput is not a function
at new WebpackCLI (/home/vagrant/sites/ecom/node_modules/webpack-cli/lib/webpack-cli.js:19:22)
at runCLI (/home/vagrant/sites/ecom/node_modules/webpack-cli/lib/bootstrap.js:7:21)
at Object. (/home/vagrant/sites/ecom/node_modules/webpack-cli/bin/cli.js:23:5)
at Module._compile (node:internal/modules/cjs/loader:1092:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
at Module.load (node:internal/modules/cjs/loader:972:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Module.require (node:internal/modules/cjs/loader:996:19)
at require (node:internal/modules/cjs/helpers:92:18)
at runCli (/home/vagrant/sites/ecom/node_modules/webpack/bin/webpack.js:54:2)
npm ERR! code 2
npm ERR! path /home/vagrant/sites/ecom
npm ERR! command failed
npm ERR! command sh -c mix
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2021-03-19T11_14_07_947Z-debug.log
npm ERR! code 2
npm ERR! path /home/vagrant/sites/ecom
npm ERR! command failed
npm ERR! command sh -c npm run development
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2021-03-19T11_14_07_974Z-debug.log
First, try to update your node.js file and then run "npm run dev" and if you again faced the same problem follow the following steps:
Step1: composer update
Step2: rm -rf node_modules
Step3: npm cache clear --force
Step4: npm install
Step5: npm outdated
In this step, it will update your laravel-mix version, it is in the package.json.
Step6: npm install
Step7: npm run dev
After all these steps, everything is good.
I hope it solve your problem.
I came across this problem when trying to build and run webpack (and webpack-cli locally), after check out from Github (not at all related to Laravel).
I found that I forgot to run yarn install for webpack-cli which lead to the issue that an existing version of commander#6 was used, but webpack-cli requires commander#7.
npm list commander should tell you that the webpack-cli dependency is unsatisfied. yarn install should fix it.

framework7 stuck at executing npm scripts and start npm throws a bunch of errors

i am new to the framework and was just going through a tutorial and encountered by an error after pressing create app in the local host
Generating package.json
✔ Creating required folders structure
✔ Installing NPM Dependencies
✔ Installing NPM Dev Dependencies
Executing NPM Scripts
this happens its stuck at executing NPM scripts waited a whole 3 hours still executing
The start npm command shows the following:-
> whatchat#1.0.0 start C:\Users\piyush\whatchat
> npm run dev
> whatchat#1.0.0 dev C:\Users\piyush\whatchat
> cross-env NODE_ENV=development webpack-dev-server --config ./build/webpack.config.js
internal/modules/cjs/loader.js:1032
throw err;
^
Error: Cannot find module 'C:\Users\piyush\whatchat\build\webpack.config.js'
Require stack:
- C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js
- C:\Users\piyush\whatchat\node_modules\webpack-dev-server\bin\webpack-dev-server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1029:15)
at Function.Module._load (internal/modules/cjs/loader.js:898:27)
at Module.require (internal/modules/cjs/loader.js:1089:19)
at require (internal/modules/cjs/helpers.js:73:18)
at WEBPACK_OPTIONS (C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js:114:13)
at requireConfig (C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js:116:6)
at C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js:123:17
at Array.forEach (<anonymous>)
at module.exports (C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js:121:15)
at Object.<anonymous> (C:\Users\piyush\whatchat\node_modules\webpack-dev-server\bin\webpack-dev-server.js:84:40) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\piyush\\whatchat\\node_modules\\webpack-cli\\bin\\utils\\convert-argv.js',
'C:\\Users\\piyush\\whatchat\\node_modules\\webpack-dev-server\\bin\\webpack-dev-server.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! whatchat#1.0.0 dev: `cross-env NODE_ENV=development webpack-dev-server --config ./build/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the whatchat#1.0.0 dev 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\piyush\AppData\Roaming\npm-cache\_logs\2020-12-15T14_13_28_671Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! whatchat#1.0.0 start: `npm run dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the whatchat#1.0.0 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\piyush\AppData\Roaming\npm-cache\_logs\2020-12-15T14_13_28_828Z-debug.log
i searched lot on Google and discord coding help servers but could not fix this please help me out
you probably didn't install cordova before try:
npm install -g cordova

Trying to set up react.js environment, not working

I used a tutorial from https://www.tutorialspoint.com/reactjs/reactjs_environment_setup.htm
got below message from command prompt when i entered "npm start" I did everything and i have node.js installed. PLEASE HELP!!
edit: wjwar is username
C:\Users\wjwar\Desktop\reactApp>npm start
> reactApp#1.0.0 start C:\Users\wjwar\Desktop\reactApp
> webpack-dev-server --mode development --open --hot
'webpack-dev-server' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! reactApp#1.0.0 start: `webpack-dev-server --mode development --open --hot`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the reactApp#1.0.0 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\wjwar\AppData\Roaming\npm-cache\_logs\2019-02-27T06_01_00_391Z-debug.log
Step 3 in the guide https://www.tutorialspoint.com/reactjs/reactjs_environment_setup.htm uses npm install --save for webpack, webpack-dev-server and webpack-cli, which is not correct. It should be npm install --save-dev
>npm install webpack --save-dev
>npm install webpack-dev-server --save-dev
>npm install webpack-cli --save-dev
Also the guide seems to be pretty outdated, I suspect it uses webpack version 3, while currently the default version of webpack is 4. You can try to find another sample with newer setup, or stick with create-react-app.
Instead, Use Create-react-app where you'll get the whole boilerplate set up, edit app.js to make your changes
install webpack and webpack-dev-server globally:
open cmd as an administrator
npm install -g webpack webpack-cli webpack-dev-server
restart cmd

SyntaxError: missing ) after argument list | nodejs | `npm start`

Running npm start is giving me a syntax error, shown in the output below.
I know how to fix a simple syntax error but I doubt that's the issue here. Looking through various forums didn't result in an answer for me.
[nodemon] starting `npm run lint && node src/app.js`
> server#1.0.0 lint C:\Users\brend\project\server
> node ./node_modules/.bin/eslint **/*.js
C:\Users\brend\project\server\node_modules\.bin\eslint:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:383:7)
at startup (bootstrap_node.js:149:9)
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\ProgramFiles\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "lint"
npm ERR! node v6.11.4
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! server#1.0.0 lint: `node ./node_modules/.bin/eslint **/*.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the server#1.0.0 lint script 'node ./node_modules/.bin/eslint **/*.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the server package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./node_modules/.bin/eslint **/*.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs server
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls server
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\brend\project\server\npm-debug.log
[nodemon] app crashed - waiting for file changes before starting...
Below is the package.json.
{
"name": "server",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node ./node_modules/nodemon/bin/nodemon.js src/app.js --exec \"npm run lint && node\" ",
"lint": "node ./node_modules/.bin/eslint **/*.js"
},
Ugh.. Okay first thing I ran into was an error saying that '.' is not recognized as an internal or external command. I googled and came to the conclusion that I needed to put node before the script. This resulted in progress; namely that it actually ran the script. Turns out it was needed at the "start" script but not the "lint" script.
My package.json scripts now look like this:
"scripts": {
"start": "node ./node_modules/nodemon/bin/nodemon.js src/app.js --exec \"npm run lint && node\" ",
"lint": "./node_modules/.bin/eslint **/*.js"
},
Which results in:
[nodemon] starting `npm run lint && node src/app.js`
> server#1.0.0 lint C:\Users\brend\project\server
> eslint **/*.js
hello
[nodemon] clean exit - waiting for changes before restart
ps: Thank you for your help kind strangers!

Issue with npm start command

While setting the environment for the Vue.js app I have encountered the issue with npm start related to node_modules and nodemon.
I am getting this error in the console when running the $npm start command:
$ npm start
> server#1.0.0 start C:\Users\Michał\desktop\it\vueapptrain\server
> node .node_modules/nodemon/.bin/nodemon.js src/app.js --exec 'npm run lint && node'
module.js:515
throw err;
^
Error: Cannot find module 'C:\Users\Michał\desktop\it\vueapptrain\server\.node_modules\nodemon\.bin\nodemon.js'
at Function.Module._resolveFilename (module.js:513:15)
at Function.Module._load (module.js:463:25)
at Function.Module.runMain (module.js:653:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! server#1.0.0 start: `node .node_modules/nodemon/.bin/nodemon.js src/app.js --exec 'npm run lint && node'`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the server#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Any ideas how this can be solved?
Firstly, ensure you have nodemon installed; npm i nodemon -S.
Then, edit the start script in your package.json to this,
node ./node_modules/.bin/nodemon src/app.js --exec 'npm run lint && node'

Resources