NPM Run <script> doesn't run any script - node.js

When I run any script with npm, no matter in what project, I get errors.
For example when I run npm run start I get the following error:
nasteas-MacBook-Pro:newapp nastea$ npm run start
npm ERR! missing script: start
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/nastea/.npm/_logs/2020-01-02T19_28_32_592Z-debug.log
this is my package.json file:
{
"name": "01-first-app",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"amocrm-api": "^1.3.1"
}
}
These are the logs:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'start' ]
2 info using npm#6.13.4
3 info using node#v12.14.0
4 verbose stack Error: missing script: start
4 verbose stack at run (/usr/local/lib/node_modules/npm/lib/run-script.js:155:19)
4 verbose stack at /usr/local/lib/node_modules/npm/lib/run-script.js:63:5
4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:116:5
4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:436:5
4 verbose stack at checkBinReferences_ (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:391:45)
4 verbose stack at final (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:434:3)
4 verbose stack at then (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:161:5)
4 verbose stack at ReadFileContext.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:350:20)
4 verbose stack at ReadFileContext.callback (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:115:16)
4 verbose stack at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:239:13)
5 verbose cwd /Users/nastea/Downloads/nodejs-basics-tutorial-master/01-first-app/newapp
6 verbose Darwin 17.7.0
7 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
8 verbose node v12.14.0
9 verbose npm v6.13.4
10 error missing script: start
11 verbose exit [ 1, true ]
I tried the following:
1. uninstalling and re-installing node.
2. npm config get ignore-scripts returns false
What could be the solution? Any help would be much appreciated.
Later edit: node doesn't run any .js file in terminal either.
Edit: run start works now.

Related

npm run devs fails on a clean install

I'm following a course and when I run npm run dev on the code I just downloaded (and that works in the video) I get this error. I've reinstalled node and npm, deleted node_modules folder and packale-lock.json and ran npm install again, doesnt work.
Here's the output
$ npm run dev
> twittor-server-client#1.0.0 dev C:\Users\Administrador\Desktop\PWA\10-twittor-offline-posting
> ./node_modules/nodemon/bin/nodemon.js server/server
"." no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! twittor-server-client#1.0.0 dev: `./node_modules/nodemon/bin/nodemon.js server/server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the twittor-server-client#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\Administrador\AppData\Roaming\npm-cache\_logs\2020-04-12T18_53_06_036Z-debug.log
Here's the debug log:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'dev'
1 verbose cli ]
2 info using npm#6.14.4
3 info using node#v12.16.2
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle twittor-server-client#1.0.0~predev: twittor-server-client#1.0.0
6 info lifecycle twittor-server-client#1.0.0~dev: twittor-server-client#1.0.0
7 verbose lifecycle twittor-server-client#1.0.0~dev: unsafe-perm in lifecycle true
8 verbose lifecycle twittor-server-client#1.0.0~dev: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Administrador\Desktop\PWA\10-twittor-offline-posting\node_modules\.bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Administrador\bin;C:\Program Files\Microsoft MPI\Bin;C:\Python27;C:\Python27\Scripts;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Crucial\Crucial Storage Executive;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Java\jdk1.8.0_201\bin;C:\apache-ant-1.10.7\bin;C:\Users\ Usuario\IdeaProjects\mysql-connector-java-5.1.48;C:\ProgramData\chocolatey\bin;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn;C:\Program Files\Microsoft SQL Server\140\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn;C:\Program Files\Microsoft SQL Server\140\DTS\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn;C:\Program Files\Git\cmd;C:\Program Files\Microsoft VS Code\bin;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\DTS\Binn;C:\MinGW\bin;C:\Program Files\nodejs;C:\Users\Administrador\AppData\Roaming\local\bin;C:\Users\Administrador\AppData\Local\Microsoft\WindowsApps;C:\Users\Administrador\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Administrador\AppData\Roaming\npm
9 verbose lifecycle twittor-server-client#1.0.0~dev: CWD: C:\Users\Administrador\Desktop\PWA\10-twittor-offline-posting
10 silly lifecycle twittor-server-client#1.0.0~dev: Args: [ '/d /s /c', './node_modules/nodemon/bin/nodemon.js server/server' ]
11 silly lifecycle twittor-server-client#1.0.0~dev: Returned: code: 1 signal: null
12 info lifecycle twittor-server-client#1.0.0~dev: Failed to exec dev script
13 verbose stack Error: twittor-server-client#1.0.0 dev: `./node_modules/nodemon/bin/nodemon.js server/server`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:310:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:310:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid twittor-server-client#1.0.0
15 verbose cwd C:\Users\Administrador\Desktop\PWA\10-twittor-offline-posting
16 verbose Windows_NT 10.0.18362
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
18 verbose node v12.16.2
19 verbose npm v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error twittor-server-client#1.0.0 dev: `./node_modules/nodemon/bin/nodemon.js server/server`
22 error Exit status 1
23 error Failed at the twittor-server-client#1.0.0 dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
And the package.json:
{
"name": "twittor-server-client",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server/server.js",
"dev": "./node_modules/nodemon/bin/nodemon.js server/server"
},
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.16.3"
},
"devDependencies": {
"nodemon": "^1.18.4",
"webpack-dev-server": "^3.10.3"
}
}
Says in the output that the "." in front of the dev script path is not recognized but this is all auto-generated...
I guess, npm cache clean && rm -rf node_modules && npm i should work.
But since you already have nodemon in your dev dependencies. Try
replacing the dev script with "nodemon server/server.js" – Rahul
Sharma Apr 12 at 19:28I guess, npm cache clean && rm -rf node_modules
&& npm i should work. But since you already have nodemon in your dev
dependencies. Try replacing the dev script with "nodemon
server/server.js" – Rahul Sharma Apr 12 at 19:28
This command worked for me:
{
"name": "twittor-server-client",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server/server.js",
"dev": "nodemon server/server.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"body-parser": "^1.18.3",
"express": "^4.16.3"
},
"devDependencies": {
"nodemon": "^1.18.4"
}
}
Hope it can help you #Julian

create-react-app npm start Error: Cannot find module '#webassemblyjs/ast'

I am just starting to learn react and I'm following the first part of this tutorial. https://www.codecademy.com/articles/how-to-create-a-react-app
I have run the following commands in Terminal:
npm install -g create-react-app
create-react-app ravenous
# I've also tried npx create-react-app ravenous as per the official React website)
# Both timesI receive a successful output that ends with 'Happy hacking'
cd ravenous
npm start
But I receive the following error in the terminal.
npm start
> ravenous#0.1.0 start /Users/sarah/sites/ravenous
> react-scripts start
module.js:559
throw err;
^
Error: Cannot find module '#webassemblyjs/ast'
at Function.Module._resolveFilename (module.js:557:15)
at Function.Module._load (module.js:484:25)
at Module.require (module.js:606:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/sarah/sites/ravenous/node_modules/webpack/lib/wasm/WebAssemblyParser.js:7:11)
at Module._compile (module.js:662:30)
at Object.Module._extensions..js (module.js:673:10)
at Module.load (module.js:575:32)
at tryModuleLoad (module.js:515:12)
at Function.Module._load (module.js:507:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ravenous#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ravenous#0.1.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! /Users/sarah/.npm/_logs/2018-10-16T17_12_05_840Z-debug.log
In node_modules I do have the #webassemblyjs/ast folder.
The debug.log has this:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm#5.6.0
3 info using node#v9.6.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle ravenous#0.1.0~prestart: ravenous#0.1.0
6 info lifecycle ravenous#0.1.0~start: ravenous#0.1.0
7 verbose lifecycle ravenous#0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle ravenous#0.1.0~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/s$
9 verbose lifecycle ravenous#0.1.0~start: CWD: /Users/sarah/sites/ravenous
10 silly lifecycle ravenous#0.1.0~start: Args: [ '-c', 'react-scripts start' ]
11 silly lifecycle ravenous#0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle ravenous#0.1.0~start: Failed to exec start script
13 verbose stack Error: ravenous#0.1.0 start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
13 verbose stack at EventEmitter.emit (events.js:127:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:127:13)
13 verbose stack at maybeClose (internal/child_process.js:933:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
14 verbose pkgid ravenous#0.1.0
15 verbose cwd /Users/sarah/sites/ravenous
16 verbose Darwin 16.7.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
18 verbose node v9.6.1
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error ravenous#0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the ravenous#0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Here is my ravenous/package.json
{
"name": "ravenous",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react-scripts": "2.0.5"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
I've checked the folder permissions on the filesystem once the ravenous folder is created, set everything to Read & Write and then retried npm start but this doesn't seem to make a difference.
I've tried deleting package-lock.json and node_modules and rerunning npm install. It doesn't help the issue although strangely package-lock.json is not recreated when I do this.
I am on Mac OS Sierra 10.12.6
npm -v gives me 5.6.0
node -v gives me 9.6.1
I downloaded the "recommended for most users" release of Node.js (currently 8.12.0 LTS) and reinstalled node.
I'm now on node 8.12.0 and npm 6.4.1 and npm start is now working.

npm ERR! missing script: build:universal

I am trying to run my Angular application on the server side and I am facing these errors:
npm ERR! missing script: build:universal
npm ERR! A complete log of this run can be found in: npm ERR!
/home/training/.npm/_logs/2018-10-03T11_50_40_593Z-debug.log
I used the official Angular application for doing this
https://angular.io/guide/universal
The universal build is causing errors shown below:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'run',
1 verbose cli 'build:universal' ]
2 info using npm#6.2.0
3 info using node#v10.8.0
4 verbose stack Error: missing script: build:universal
4 verbose stack at run (/usr/local/lib/node_modules/npm/lib/run-script.js:155:19)
4 verbose stack at /usr/local/lib/node_modules/npm/lib/run-script.js:63:5
4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:115:5
4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:418:5
4 verbose stack at checkBinReferences_ (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:373:45)
4 verbose stack at final (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:416:3)
4 verbose stack at then (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:160:5)
4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:280:12
4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:78:16
4 verbose stack at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
5 verbose cwd /home/training/Desktop/vishnu/TemplateAppv6
6 verbose Linux 4.4.0-134-generic
7 verbose argv "/usr/bin/nodejs" "/usr/local/bin/npm" "run" "build:universal"
8 verbose node v10.8.0
9 verbose npm v6.2.0
10 error missing script: build:universal
11 verbose exit [ 1, true ]
As implied in my comment, you may have forgotten to add the build-script to your project:
From the universal docs
Build and run with universal: Now that you've created the TypeScript
and Webpack config files and configured the Angular CLI, you can build
and run the Universal application.
First add the build and serve commands to the scripts section of the
package.json:
"scripts": {
...
"build:ssr": "npm run build:client-and-server-bundles && npm run webpack:server",
"serve:ssr": "node dist/server",
"build:client-and-server-bundles": "ng build --prod && ng run angular.io-example:server",
"webpack:server": "webpack --config webpack.server.config.js --progress --colors"
...
}
So check you package.json and try the build again..

npm start - npm ERR! missing script: start

I'm receiving this error when trying to my node application using the npm start command.
WhenIi try to npm start I get this error.
Error:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm#5.6.0
3 info using node#v8.10.0
4 verbose stack Error: missing script: start
4 verbose stack at run (C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:151:19)
4 verbose stack at C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:61:5
4 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:115:5
4 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:402:5
4 verbose stack at checkBinReferences_ (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:357:45)
4 verbose stack at final (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:400:3)
4 verbose stack at then (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:160:5)
4 verbose stack at ReadFileContext.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:332:20)
4 verbose stack at ReadFileContext.callback (C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:78:16)
4 verbose stack at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:420:13)
5 verbose cwd B:\tut\starter
6 verbose Windows_NT 6.1.7601
7 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
8 verbose node v8.10.0
9 verbose npm v5.6.0
10 error missing script: start
11 verbose exit [ 1, true ]
From the debug file:
{
"name": "sridhar",
"version": "1.0.0",
"description": "landing page",
"main": "index.js",
"scripts": {
"compile:sass": "node-sass sass/main.scss css/style.css -w"
},
"author": "sridhar",
"license": "ISC",
"devDependencies": {
"node-sass": "^4.8.3"
}
}
You are missing the entry start in the scripts section of your package.json. If you want to compile the file using npm start then, you should copy node-sass sass/main.scss css/style.css -w and paste it as a value for start. You can add any command you would like to execute as the value for start.
Having said that, if you do npm "compile:sass" it will compile your sass files if you don't want to change your package.json.
"scripts": {
...
"compile:sass": "node-sass sass/main.scss css/style.css -w",
"start": "node-sass sass/main.scss css/style.css -w"
},
Because there is no start script... Just change compile script to start script... Then it will compile your sass files...
"scripts": {
"start": "node-sass sass/main.scss css/style.css -w"
},
npx proved to be more effective to me, instead of using npm after several trials.
The below code worked for me:
npx babel --watch src --out-dir . --presets react-app/prod
It did not require me to manually edit the package.json anymore. Everything went smooth.
For more information please refer to the official documentation page https://reactjs.org/docs/add-react-to-a-website.html#optional-try-react-with-jsx
Cheers
Try removing npx and just use create-react-app itworks
You should remove whatever is there in the script object (If you have just created the project) in package.json file, and put these two lines in.
"start": "webpack-dev-server --mode development --open --hot",
"build": "webpack --mode production"
Folks forget to do that sometimes.And leave the "test" case in. Also make sure you have installed all the dependencies you need for your project, from webpack-cli to other stuff mentioned in the error stack trace.
Hope this works.

webpack-dev-server fails to run

I am new to reactjs and webpack. So I am trying the following awesome video to install webpack and dev server:
Setup Workspace with Webpack
and here is the sample project I am working on:
project
I did everything step by step and now when I run npm start I get the following error:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm- cli.js',
1 verbose cli 'start' ]
2 info using npm#3.10.10
3 info using node#v7.2.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle reactjs-basics#1.0.0~prestart: reactjs-basics#1.0.0
6 silly lifecycle reactjs-basics#1.0.0~prestart: no script for prestart, continuing
7 info lifecycle reactjs-basics#1.0.0~start: reactjs-basics#1.0.0
8 verbose lifecycle reactjs-basics#1.0.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle reactjs-basics#1.0.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\tj\reactjs-basics\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32 ;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\CCM;C:\WINDOWS\CCM;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Program Files\MySQL\MySQL Utilities 1.6\;C:\Program Files\Java\jdk1.8.0_111\bin;C:\Users\hminaee\AppData\Roaming\npm
10 verbose lifecycle reactjs-basics#1.0.0~start: CWD: C:\tj\reactjs-basics
11 silly lifecycle reactjs-basics#1.0.0~start: Args: [ '/d /s /c', 'npm run build' ]
12 silly lifecycle reactjs-basics#1.0.0~start: Returned: code: 1 signal: null
13 info lifecycle reactjs-basics#1.0.0~start: Failed to exec start script
14 verbose stack Error: reactjs-basics#1.0.0 start: `npm run build`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:885:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid reactjs-basics#1.0.0
16 verbose cwd C:\tj\reactjs-basics
17 error Windows_NT 6.1.7601
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
19 error node v7.2.1
20 error npm v3.10.10
21 error code ELIFECYCLE
22 error reactjs-basics#1.0.0 start: `npm run build`
22 error Exit status 1
23 error Failed at the reactjs-basics#1.0.0 start script 'npm run build'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the reactjs-basics package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error npm run build
23 error You can get information on how to open an issue for this project with:
23 error npm bugs reactjs-basics
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls reactjs-basics
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
Also here is my package.json file:
{
"name": "reactjs-basics",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "npm run build",
"build": "webpack -d && cp src/index.html dist/index.html && webpack-dev- server --content-base src/ --inline --hot --port 3003",
"build:prod": "webpack -p && cp src/index.html dist/index.html"
},
"author": "",
"license": "ISC",
"dependencies": {
"react": "^15.4.1",
"react-dom": "^15.4.1",
"webpack-dev-server": "^1.16.2"
},
"devDependencies": {
"babel-core": "^6.20.0",
"babel-loader": "^6.2.9",
"babel-preset-es2015": "^6.18.0",
"babel-preset-react": "^6.16.0",
"babel-preset-stage-2": "^6.18.0",
"webpack": "^1.14.0",
"webpack-dev-server": "^1.16.2"
}
}
I checked the web and I saw many solution regarding to the port. So I change the port to an open port like this : --port 3003 but still webpack-dev-server does not work.
Can anyone help?

Resources