Closed tqangxl closed 7 years ago
+1
I meet same issue, just remove --cors
options in npm start scripts is ok.
"scripts": {
...
"server": "webpack-dev-server --inline --progress --port 3000 --content-base src"
...
}
Maybe need install other to make the option works
sorry about that. it's fixed now
C:\Windows\system32>npm install -g webpack webpack-dev-server typescript C:\Users\James\AppData\Roaming\npm\tsc -> C:\Users\James\AppData\Roaming\npm\node_modules\typescript\bin\tsc C:\Users\James\AppData\Roaming\npm\tsserver -> C:\Users\James\AppData\Roaming\npm\node_modules\typescript\bin\tsserver C:\Users\James\AppData\Roaming\npm\webpack-dev-server -> C:\Users\James\AppData\Roaming\npm\node_modules\webpack-dev-server\bin\webpack-dev-server.js C:\Users\James\AppData\Roaming\npm\webpack -> C:\Users\James\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js C:\Users\James\AppData\Roaming\npm +-- typescript@2.1.4 +-- webpack@1.14.0 | +-- acorn@3.3.0 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\webpack\node_modules\chokidar\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.15: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
E:\Developers\test\angular2-seed-master>npm install angular2-seed@1.0.0 E:\Developers\test\angular2-seed-master
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.15: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
-------------------------------------check install----------------------------
E:\Developers\test\angular2-seed-master> npm list -g --depth=0 C:\Users\James\AppData\Roaming\npm +-- typescript@2.1.4 +-- webpack@1.14.0 `-- webpack-dev-server@1.16.2
E:\Developers\test\angular2-seed-master> npm list --depth=0 angular2-seed@1.0.0 E:\Developers\test\angular2-seed-master +-- @angular/common@2.2.4 +-- @angular/compiler@2.2.4 +-- @angular/compiler-cli@2.2.4 +-- @angular/core@2.2.4 +-- @angular/forms@2.2.4 +-- @angular/http@2.2.4 +-- @angular/platform-browser@2.2.4 +-- @angular/platform-browser-dynamic@2.2.4 +-- @angular/platform-server@2.2.4 +-- @angular/router@3.2.4 +-- @angular/upgrade@2.2.4 +-- @types/node@6.0.51 +-- angular2-in-memory-web-api@0.0.21 +-- angular2-router-loader@0.3.4 +-- angular2-template-loader@0.6.0 +-- awesome-typescript-loader@2.2.4 +-- bootstrap@3.3.7 +-- core-js@2.4.1 +-- css-loader@0.25.0 +-- ie-shim@0.1.0 +-- raw-loader@0.5.1 +-- reflect-metadata@0.1.8 +-- rxjs@5.0.0-beta.12 +-- to-string-loader@1.1.5 +-- typescript@2.0.10 +-- webpack@2.1.0-beta.27 +-- webpack-dev-server@2.1.0-beta.11 +-- webpack-merge@0.15.0 `-- zone.js@0.6.26
E:\Developers\test\angular2-seed-master>
--------------------------------------------run -------------------------------------- E:\Developers\test\angular2-seed-master>npm start
webpack-dev-server 2.1.0-beta.11 webpack 2.1.0-beta.27 Usage: http://webpack.github.io/docs/webpack-dev-server.html
Config options: --config Path to the config file [string] [default: webpack.config.js or webpackfile.js] --env Enviroment passed to the config, when it is a function
Basic options: --context The root directory for resolving entry point and stats [string] [default: The current directory] --entry The entry point [string] --watch, -w Watch the filesystem for changes [boolean] --debug Switch loaders to debug mode [boolean] --devtool Enable devtool for better debugging experience (Example: --devtool eval-cheap-module-source-map) [string] -d shortcut for --debug --devtool eval-cheap-module-source-map --output-pathinfo [boolean] -p shortcut for --optimize-minimize --define process.env.NODE_ENV="production" [boolean] --progress Print compilation progress in percentage [boolean]
Module options: --module-bind Bind an extension to a loader [string] --module-bind-post [string] --module-bind-pre [string]
Output options: --output-path The output path for compilation assets [string] [default: The current directory] --output-filename The output filename of the bundle [string] [default: [name].js] --output-chunk-filename The output filename for additional chunks [string] [default: filename with [id] instead of [name] or [id] prefixed] --output-source-map-filename The output filename for the SourceMap [string] --output-public-path The public path for the assets [string] --output-jsonp-function The name of the jsonp function used for chunk loading [string] --output-pathinfo Include a comment with the request for every dependency (require, import, etc.) [boolean] --output-library Expose the exports of the entry point as library [string] --output-library-target The type for exposing the exports of the entry point as library [string]
Advanced options: --records-input-path Path to the records file (reading) [string] --records-output-path Path to the records file (writing) [string] --records-path Path to the records file [string] --define Define any free var in the bundle [string] --target The targeted execution enviroment [string] --cache Enable in memory caching [boolean] [default: It's enabled by default when watching] --watch-stdin, --stdin close when stdin ends [boolean] --watch-aggregate-timeout Timeout for gathering changes while watching --watch-poll The polling intervall for watching (also enable polling) [boolean] --hot Enables Hot Module Replacement [boolean] --prefetch Prefetch this request (Example: --prefetch ./file.js) [string] --provide Provide these modules as free vars in all modules (Example: --provide jQuery=jquery) [string] --labeled-modules Enables labeled modules [boolean] --plugin Load this plugin [string] --bail Abort the compilation on first error [boolean] --profile Profile the compilation and include information in stats [boolean] --hot-only Do not refresh page if HMR fails [boolean]
Resolving options: --resolve-alias Setup a module alias for resolving (Example: jquery-plugin=jquery.plugin) [string] --resolve-extensions Setup extensions that should be used to resolve modules (Example: --resolve-extensions .es6 .js) [array] --resolve-loader-alias Setup a loader alias for resolving [string]
Optimizing options: --optimize-max-chunks Try to keep the chunk count below a limit --optimize-min-chunk-size Try to keep the chunk size above a limit --optimize-minimize Minimize javascript and switches loaders to minimizing [boolean]
Stats options: --info Info [boolean] [default: true] --quiet Quiet [boolean] --client-log-level Log level in the browser (info, warning, error or none) [string] [default: "info"]
SSL options: --https HTTPS [boolean] --key Path to a SSL key. [string] --cert Path to a SSL certificate. [string] --cacert Path to a SSL CA certificate. [string] --pfx Path to a SSL pfx file. [string] --pfx-passphrase Passphrase for pfx file. [string]
Response options: --content-base A directory or URL to serve HTML content from.[string] --watch-content-base Enable live-reloading of the content-base. [boolean] --history-api-fallback Fallback to /index.html for Single Page Applications. [boolean] --compress Enable gzip compression [boolean]
Connection options: --port The port --socket Socket to listen --public The public hostname/ip address of the server [string] --host The hostname/ip address the server will bind to [string] [default: "localhost"]
Options: --help, -h Show help [boolean] --version, -v Show version number [boolean] --lazy Lazy [boolean] --inline Inline mode (set to false to disable including client scripts like livereload) [boolean] [default: true] --open Open default browser [boolean]
Unknown argument: cors
npm ERR! Windows_NT 10.0.14393 64bit 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 64bit 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! E:\Developers\test\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! E:\Developers\test\angular2-seed-master\npm-debug.log
E:\Developers\test\angular2-seed-master>