angular / angular2-seed

MIT License
1.01k stars 640 forks source link

Failed at the angular2-seed@1.0.0 start script 'npm run server'. #146

Closed coderabsolute closed 7 years ago

coderabsolute commented 7 years ago

I get this error when I run the "npm start", can someone please help?

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "server"
npm ERR! node v6.9.2
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! angular2-seed@1.0.0 server: `webpack-dev-server --inline --progress --cors --port 3000 --content-base src`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular2-seed@1.0.0 server script 'webpack-dev-server --inline --progress --cors --port 3000 --content-base src'.
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-seed package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webpack-dev-server --inline --progress --cors --port 3000 --content-base src
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs angular2-seed
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls angular2-seed
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Business\angular2-seed-master\npm-debug.log

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.9.2
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! angular2-seed@1.0.0 start: `npm run server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular2-seed@1.0.0 start script 'npm run server'.
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-seed package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run server
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs angular2-seed
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls angular2-seed
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Business\angular2-seed-master\npm-debug.log
zelkin commented 7 years ago

There is an error with Webpack,: Unknown argument cors

When we launch npm start, we launch webpack-dev-server --inline --progress --cors --port 3000 --content-base src

coderabsolute commented 7 years ago

Wondering, how can I fix it?

zelkin commented 7 years ago

i don't know, i searching... Make sure you have the latest version of nodeJS by checking "node -v" in your cmd. Then update it by download the latest package in nodejs.org.

zelkin commented 7 years ago

There was a modification in the repo : https://github.com/angular/angular2-seed/commit/06a74556492e029cb4b0912925832d7dd19969b8

Edit your package.json and remove de --cors line 8. and retry to write "run start".

It work for me, Enjoy !

konradrenner commented 7 years ago

Hi, what is the --cors intended to do?

ghost commented 7 years ago

The --cors option works with webpack-dev-server 1.16.2, and it's not in the documentation (it's not even appearing with the --help option). I supose it's related with https://github.com/webpack/webpack-dev-server/pull/110 but honestly I don't see the need of the cors option as a general solution.

konradrenner commented 7 years ago

Thx for the Link! So this option will enable Cross-Origin Resource Sharing on newer webpack-dev-server.

konradrenner commented 7 years ago

So for local development it is unnecessary I think...

PatrickJS commented 7 years ago

sorry about that, it's fixed now. thanks