Bootstrap4-NPM start error - npm

I am learning to automate web development tasks using npm scripts.
Below is my package.json:
{
"name": "confusion",
"version": "1.0.0",
"description": "This is a website for Ristorante Con Fusion",
"main": "index.html",
"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'"
},
"author": "",
"license": "ISC",
"devDependencies": {
"lite-server": "^2.2.2",
"node-sass": "^4.7.2",
"onchange": "^3.3.0",
"parallelshell": "^3.0.2"
},
"dependencies": {
"bootstrap": "^4.0.0-alpha.6",
"font-awesome": "^4.7.0"
}
}
However, when I run npm start in the command prompt I encounter the following error:
Error message:
D:\encypher technologies\Bootstrap4-starter\Bootstrap4\conFusion>npm start
confusion#1.0.0 start D:\encypher technologies\Bootstrap4-starter\Bootstrap4\conFusion
npm run watch:all
confusion#1.0.0 watch:all D:\encypher technologies\Bootstrap4-starter\Bootstrap4\conFusion
parallelshell 'npm run watch:scss' 'npm run lite'
'npm' is not recognized as an internal or external command, operable program or batch file.
'run' is not recognized as an internal or external command, operable program or batch file.
The filename, directory name, or volume label syntax is incorrect.
'npm' is not recognized as an internal or external command,
operable program or batch file.
'run' is not recognized as an internal or external command, operable program or batch file.
'lite'' is not recognized as an internal or external command, operable program or batch file.
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\NIKHIL\AppData\Roaming\npm-cache\_log\2018-01-08T11_13_45_703Z-debug.log
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\NIKHIL\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v8.9.3
npm ERR! npm v2.15.12
npm ERR! code ELIFECYCLE
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 run watch:all'.
npm ERR! This is most likely a problem with the confusion package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run watch:all
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs confusion
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls confusion
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! D:\encypher technologies\Bootstrap4-starter\Bootstrap4\conFusion\npm-debug.log

I guess you are using Windows. The Windows command line doesn't like single quotes in package.json. Use \" instead.
"watch:scss": "onchange \"css/*.scss\" -- npm run scss",
"watch:all": "parallelshell \"npm run watch:scss\" \"npm run lite\""
You were also missing the space between -- and npm.

Related

Error while executing "npm start" command

I installed npm and changed the package.json file so that it can automatically compile the .scss file into a css file when npm start is used. the changes made are as follows.
"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\""
},
but when I run the "npm start" command it returns an error. The error is as follows.
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\DJ\AppData\Roaming\npm-cache\_logs\2020-07-16T15_52_00_182Z-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\DJ\AppData\Roaming\npm-cache\_logs\2020-07-16T15_52_00_229Z-debug.log
please help me solve this problem,
I want to complete my project but this error is in my way.
It is a bug from parallelshell. We will have to manually edit file to fix this error
You need to go to the file:
node_modules/parallelshell/index.js:105
Then change this line:
cwd: process.versions.node < '8.0.0' ? process.cwd : process.cwd(),
To this:
cwd: parseInt(process.versions.node) < 8 ? process.cwd : process.cwd()
Then things will work well

`npm start` failed after `npm run eject`

Command start unrecognized. Make sure that you have run npm install and that you are inside a react-native project.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # start: react-native start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # 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\Ishan\AppData\Roaming\npm-cache_logs\2019-02-24T11_24_50_101Z-debug.log
You are missing a start script in your package.json
Your package.json must have a start script like so -
{
"scripts": {
"start": "react-native-scripts start"
}
}

In Vue-CLI run dev, fail.

In the vue-cli, I want to npm run dev, but get the bellow error:
$ npm run dev
> vuejs-playlist#1.0.0 dev /Users/den/Desktop/Test/vue/vuejs-playlist
> cross-env NODE_ENV=development webpack-dev-server --open --hot
sh: cross-env: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! vuejs-playlist#1.0.0 dev: `cross-env NODE_ENV=development webpack-dev-server --open --hot`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the vuejs-playlist#1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/den/.npm/_logs/2018-02-02T11_54_11_067Z-debug.log
Try as follows for #vue/cli
npm run serve
In your traceback:
Local package.json exists, but node_modules missing, did you mean to install?
You should in your project root directory install the dependencies:
npm install
Or use its logogram npm i
As both answers before stated your build failed due needing to first:
npm install
Once that is complete, check your package.json file.
In there will have the default options for npm run followed by your build script option.
Example:
{
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
}
}
Resulting in your npm run serve is the same as vue-cli-service serve
Reference: Vue Docs

Unable to start app with npm start

I have followed the instructions in https://angular.io/guide/quickstart and created the corresponding quickstart files and installed dependencies using npm install command. After that when I issue npm start command I am getting the following error.
npm ERR! Linux 3.13.0-32-generic
npm ERR! argv "node" "/usr/local/bin/npm" "start"
npm ERR! node v0.10.25
npm ERR! npm v3.9.0
npm ERR! code ELIFECYCLE
npm ERR! angular2-quickstart#1.0.0 start: `tsc && concurrently "npm run tsc:w" "npm run lite" `
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the angular2-quickstart#1.0.0 start script 'tsc && concurrently "npm run tsc:w" "npm run lite" '.
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 angular2-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! tsc && concurrently "npm run tsc:w" "npm run lite"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular2-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular2-quickstart
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/sobin/AngularTuts/heroappbase/npm-debug.log
First, I tried just running this command in the command prompt:
concurrently "npm run tsc:w" "npm run lite"
That worked. Then, in the package.json file, I replaced this line:
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
With this:
"start": "concurrently \"npm run tsc:w\" \"npm run lite\" ",
At that point, npm start worked normally. Hope that helps.
According to their docs, angular2 requires at least node 5.x.x
From their site:
Verify that you are running at least node v5.x.x and npm 3.x.x by running node -v and npm -v in a terminal/console window. Older versions produce errors.
Looks like you are running node v0.10.25. Try upgrading.
To upgrade, you can use nvm which lets you switch easily between the versions. nvm on GitHub.

webpack-dev-server: npm error Windows_NT 7601

I have got the following error while I tried to command :
$ npm run dev
I have also used nodejs cmd, git and also having administritive privileges with the cmd.
Error is like following:
D:\IIT Samester\KAZ\ReactJSProjects\GitFrom\webpack-example-master\webpack-examp
le-master>npm run dev
> webpack-example#0.0.0 dev D:\IIT Samester\KAZ\ReactJSProjects\GitFrom\webpack-example-master\webpack-example-master
> webpack-dev-server --devtool eval --progress --colors --hot --content-base build/
70% 1/1 build modulesevents.js:85
throw er; // Unhandled 'error' event
^
Error: listen EACCES
at exports._errnoException (util.js:746:11)
at Server._listen2 (net.js:1129:19)
at listen (net.js:1172:10)
at net.js:1270:9
at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:81:16)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:99:10)
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "node" "C:\\Users\\hp\\AppData\\Roaming\\npm\\node_modules\\npm\\b
in\\npm-cli.js" "run" "dev"
npm ERR! node v0.12.2
npm ERR! npm v2.7.6
npm ERR! code ELIFECYCLE
npm ERR! webpack-example#0.0.0 dev: `webpack-dev-server --devtool eval --progress --colors --hot --content-base build/`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webpack-example#0.0.0 dev script 'webpack-dev-server--devtool eval --progress --colors --hot --content-base build/'.
npm ERR! This is most likely a problem with the webpack-example package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webpack-dev-server --devtool eval --progress --colors --hot --content-base build/
npm ERR! You can get their info via:
npm ERR! npm owner ls webpack-example
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\IIT Samester\KAZ\ReactJSProjects\GitFrom\webpack-example-master\
webpack-example-master\npm-debug.log
D:\IIT Samester\KAZ\ReactJSProjects\GitFrom\webpack-example-master\webpack-example-master>
Please do help to solve the issue.
Yes, I have solved the issue by self.
Its a problem on the port, nothing else.
I have other program that works on port 8080.
webpack-dev-server also wants to use that port by default.
So I have just change the port number from 8080 to 8081 (can be anything valid other) in the ProjectFolder \node_modules\webpack-dev-server\bin\webpack-dev-server.js file.
Anothe solution is that you can stop that program working on port 8080.
Thank you :)