Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed at npm run dev #714

Closed
ajhsu opened this issue Jan 9, 2018 · 24 comments
Closed

Failed at npm run dev #714

ajhsu opened this issue Jan 9, 2018 · 24 comments

Comments

@ajhsu
Copy link

ajhsu commented Jan 9, 2018

For those people who encounter the following error messages:

$ vue init webpack-simple simple-example
$ cd simple-example
$ npm install
$ npm run dev

ajhsu-mbpr:simple-example ajhsu$ npm run dev

> simple-example@1.0.0 dev /Users/ajhsu/Git/vue/simple-example
> cross-env NODE_ENV=development webpack-dev-server --open --hot

webpack-dev-server 2.10.0
webpack 3.10.0
Usage: https://webpack.js.org/configuration/dev-server/

Config options:
  --config       Path to the config file
                         [string] [default: webpack.config.js or webpackfile.js]
  --config-name  Name of the config to use                              [string]

....

  --open-page   Open default browser with the specified page            [string]

Missing argument values: config, config-name, context, entry, module-bind, module-bind-post, module-bind-pre, output-path, output-filename, output-chunk-filename, output-source-map-filename, output-public-path, output-jsonp-function, output-library, output-library-target, records-input-path, records-output-path, records-path, define, target, watch-aggregate-timeout, devtool, resolve-alias, resolve-extensions, resolve-loader-alias, optimize-max-chunks, optimize-min-chunk-size, prefetch, provide, plugin, open-page
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! simple-example@1.0.0 dev: `cross-env NODE_ENV=development webpack-dev-server --open --hot`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the simple-example@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!     /Users/ajhsu/.npm/_logs/2018-01-09T09_28_10_300Z-debug.log

It seems caused by a known issue on webpack-dev-server@2.10.0. While the generated vue project is requiring webpack-dev-server@^2.9.1 which may install the broken version 2.10.0 that causes the error.

You can now temporary fix it by assigning the version of webpack-dev-server to 2.9.7 in your package.json like this: "webpack-dev-server": "2.9.7".

@G-Veigar
Copy link

G-Veigar commented Jan 9, 2018

+1

@beer-on-ice
Copy link

++++++11111111111111111111111111

@roytime
Copy link

roytime commented Jan 9, 2018

yarn remove webpack-dev-server
yarn add webpack-dev-server@2.9.1 --dev
yarn run dev

OK!

@axtho
Copy link

axtho commented Jan 9, 2018

Yeah, it is a webpack 2.9.10 issue. Downgrading this will help.

@ajhsu
Copy link
Author

ajhsu commented Jan 9, 2018

@axtho Actually there has no webpack-dev-server@2.9.10, it's the problem of webpack-dev-server@2.10.0. 😄

@axtho
Copy link

axtho commented Jan 9, 2018

Right. That is correct.

@qingyunmeng042515
Copy link

yarn remove webpack-dev-server
yarn add webpack-dev-server@2.9.1 --dev
yarn run dev

亲测可以

@yyx990803
Copy link
Member

2.10.1 should fix it too.

@pvfhv
Copy link

pvfhv commented Jan 16, 2018

2.11.0无此Bug

@rgalaxy
Copy link

rgalaxy commented Jan 22, 2018

'cross-env' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app@1.0.0 dev: cross-env NODE_ENV=development webpack-dev-server --open --hot
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-app@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

hi I still encounter this even after changing the webpack-dev-server to ^2.9.7

i just install vue-cli and this is my package json

{
"name": "my-app",
"description": "A Vue.js project",
"version": "1.0.0",
"author": "",
"license": "MIT",
"private": true,
"scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
},
"dependencies": {
"vue": "^2.5.11"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
],
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.0",
"babel-preset-stage-3": "^6.24.1",
"cross-env": "^5.0.5",
"css-loader": "^0.28.7",
"file-loader": "^1.1.4",
"node-sass": "^4.5.3",
"sass-loader": "^6.0.6",
"vue-loader": "^13.0.5",
"vue-template-compiler": "^2.4.4",
"webpack": "^3.6.0",
"webpack-dev-server": "^2.9.7"
}
}

how do i fix this?

@ajhsu
Copy link
Author

ajhsu commented Jan 23, 2018

@rgalaxy That's not the problem related to this issue;

I think It's simply because you haven't run npm install before npm run dev or npm run build yet.

@anson-GH
Copy link

change the config >index.js port: 8080 to other port eg, port: 8081

@slwzero
Copy link

slwzero commented Jan 3, 2019

npm uninstall webpack-dev-server
npm install webpack-dev-server@2.9.1 --dev
npm run serve

It works perfectly!💝

@tannhauserr
Copy link

@slwzero thanks, in 2019 and it's still failing

@MattHaydon
Copy link

@slwzero thanks, in 2019 and it's still failing

Same. --unsafe-perm seemed. to fix.

@automatonatm
Copy link

npm remove webpack-dev-server
npm add webpack-dev-server@2.9.1 --dev
nmp run dev

this solves the whole problem

@toeurtenh
Copy link

toeurtenh commented Mar 24, 2019

thank you, it works for me

@161710132
Copy link

help me

@mohammadnazari110
Copy link

rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install

npm add webpack-dev-server@2.9.1 --dev

@toeurtenh
Copy link

toeurtenh commented Apr 15, 2019 via email

@vinnysihombing
Copy link

okee ^^

@uroosehar1
Copy link

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hellovue@1.0.0 dev: webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hellovue@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! /Users/uroo/.npm/_logs/2020-06-17T07_32_00_033Z-debug.log

cannot run node project suddenly

@FOWnglp
Copy link

FOWnglp commented Apr 27, 2022

webpack-dev-server

我的还是不行

@sarwaras
Copy link

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! 03-webpack-ts@1.0.0 dev: cross-env NODE_ENV=development webpack-dev-server --config build/webpack.config.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the 03-webpack-ts@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\rtt\AppData\Roaming\npm-cache_logs\2022-05-19T02_56_16_701Z-debug.log
Waiting for the debugger to disconnect...

The above method still doesn't solve my problem~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests