javascript - Webpack: error while running "npm start" - Stack Overflow

I've cloned an egghead project using webpack (great tutorial).I've ran into the following er

I've cloned an egghead project using webpack (great tutorial). I've ran into 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\nodemodules\npm\bin\npm-cli.js',
1 verbose cli 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink c:\Program Files\nodejs\node.exe
5 verbose run-script [ 'prestart', 'start', 'poststart' ]
6 info prestart [email protected]
7 info start [email protected]
8 verbose unsafe-perm in lifecycle true
9 info [email protected] Failed to exec start script
10 verbose stack Error: [email protected] start: `node nodemodules/.bin/webpack-dev-server --content-base app
10 verbose stack Exit status 1
10 verbose stack at EventEmitter.<anonymous> (c:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:213:16)
10 verbose stack at EventEmitter.emit (events.js:110:17)
10 verbose stack at ChildProcess.<anonymous> (c:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:14:12)
10 verbose stack at ChildProcess.emit (events.js:110:17)
10 verbose stack at maybeClose (child_process.js:1008:16)
10 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
11 verbose pkgid [email protected]
12 verbose cwd C:\Users\Yonk\Documents\webPackApp
13 error Windows_NT 6.1.7601
14 error argv "c:\\Program Files\\nodejs\\\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
15 error node v0.12.0
16 error npm v2.5.1
17 error code ELIFECYCLE
18 error [email protected] start:node nodemodules/.bin/webpack-dev-server --content-base app`
18 error Exit status 1
19 error Failed at the [email protected] start script 'node nodemodules/.bin/webpack-dev-server --content-base app'.
19 error This is most likely a problem with the webpack-angular package,
19 error not with npm itself.
19 error Tell the author that this fails on your system:
19 error node node_modules/.bin/webpack-dev-server --content-base app
19 error You can get their info via:
19 error npm owner ls webpack-angular
19 error There is likely additional logging output above.
20 verbose exit [ 1, true ]

My steps were:

  1. Unzip
  2. npm install
  3. npm start

Any idea why this happened and how to fix this?

I've cloned an egghead project using webpack (great tutorial). I've ran into 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\nodemodules\npm\bin\npm-cli.js',
1 verbose cli 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink c:\Program Files\nodejs\node.exe
5 verbose run-script [ 'prestart', 'start', 'poststart' ]
6 info prestart [email protected]
7 info start [email protected]
8 verbose unsafe-perm in lifecycle true
9 info [email protected] Failed to exec start script
10 verbose stack Error: [email protected] start: `node nodemodules/.bin/webpack-dev-server --content-base app
10 verbose stack Exit status 1
10 verbose stack at EventEmitter.<anonymous> (c:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:213:16)
10 verbose stack at EventEmitter.emit (events.js:110:17)
10 verbose stack at ChildProcess.<anonymous> (c:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:14:12)
10 verbose stack at ChildProcess.emit (events.js:110:17)
10 verbose stack at maybeClose (child_process.js:1008:16)
10 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
11 verbose pkgid [email protected]
12 verbose cwd C:\Users\Yonk\Documents\webPackApp
13 error Windows_NT 6.1.7601
14 error argv "c:\\Program Files\\nodejs\\\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
15 error node v0.12.0
16 error npm v2.5.1
17 error code ELIFECYCLE
18 error [email protected] start:node nodemodules/.bin/webpack-dev-server --content-base app`
18 error Exit status 1
19 error Failed at the [email protected] start script 'node nodemodules/.bin/webpack-dev-server --content-base app'.
19 error This is most likely a problem with the webpack-angular package,
19 error not with npm itself.
19 error Tell the author that this fails on your system:
19 error node node_modules/.bin/webpack-dev-server --content-base app
19 error You can get their info via:
19 error npm owner ls webpack-angular
19 error There is likely additional logging output above.
20 verbose exit [ 1, true ]

My steps were:

  1. Unzip
  2. npm install
  3. npm start

Any idea why this happened and how to fix this?

Share Improve this question asked Apr 28, 2015 at 10:15 yccteamyccteam 2,3114 gold badges29 silver badges50 bronze badges 3
  • Can you try against Node 0.10? Maybe this is Node version related. – Juho Vepsäläinen Commented May 1, 2015 at 18:40
  • 2 were there any errors during npm install? – Frank Bryce Commented Jul 16, 2015 at 14:34
  • I am probably wrong but can you try changing node node_modules/.bin/webpack-dev-server --content-base app to backward slash because its windows? – Rahat Mahbub Commented Jul 17, 2015 at 4:29
Add a ment  | 

2 Answers 2

Reset to default 6

The initial configuration of the lesson using bash script server runs under Linux, resulting in an error on Windows. To start the server under the Windows you need change at package.json start script line:

from this:

"start": "node node_modules/.bin/webpack-dev-server --content-base app"

to this:

"start": "node_modules/.bin/webpack-dev-server.cmd --content-base app"

Actually, this issue is created whenever you are not giving the specific path to node_modules for the interaction of node js. These kinds of issues have e on screen.

Make sure your react-app project is in a specific folder nothing else is present only the node modules folder, public folder, src folder, package.json, etc. This kind of stuff is not placed correctly in one folder. So these kinds of issues e to screen.

I think these are correct and valid reasons. I was facing these issues and resolved these issues by doing this.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742311055a4419902.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信