cli-serve can't run on Linux
See original GitHub issueVersion
3.0.0-rc.11
Node and OS info
Node 10.6.0 OpenSUSE Tumbleweed 20180809
Steps to reproduce
on OpenSUSE tumbleweed, run su npm install -g @vue/cli npm install -g @vue/cli-service
then run as common user vue create hello-world npm run serve
but failed
hello-world@0.1.0 serve /home/user/hello-world vue-cli-service serve
INFO Starting development server… 10% building modules 0/1 modules 1 active …webpack/hot/ 10% building modules 1/1 modules 0 activeevents.js:167 throw er; // Unhandled ‘error’ event ^
Error: getaddrinfo ENOTFOUND shumeipc
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
Emitted ‘error’ event at:
at GetAddrInfoReqWrap.doListen [as callback] (net.js:1506:12)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hello-world@0.1.0 serve: vue-cli-service serve
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hello-world@0.1.0 serve 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! /home/user/.npm/_logs/2018-08-09T03_01_11_654Z-debug.log
What is expected?
please correct this bug
What is actually happening?
cli-serve can’t run
the following context is ~/.npm/_logs/2018-08-09T03_01_11_654Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/bin/node10’, ‘/usr/bin/npm-default’, ‘run’, ‘serve’ ]
2 info using npm@6.1.0
3 info using node@v10.6.0
4 verbose run-script [ ‘preserve’, ‘serve’, ‘postserve’ ]
5 info lifecycle hello-world@0.1.0~preserve: hello-world@0.1.0
6 info lifecycle hello-world@0.1.0~serve: hello-world@0.1.0
7 verbose lifecycle hello-world@0.1.0~serve: unsafe-perm in lifecycle true
8 verbose lifecycle hello-world@0.1.0~serve: PATH: /usr/lib64/node_modules/npm10/node_modules/npm-lifecycle/node-gyp-bin:/home/user/hello-world/node_modules/.bin:/home/user/bin:/usr/local/bin:/usr/bin:/bin
9 verbose lifecycle hello-world@0.1.0~serve: CWD: /home/user/hello-world
10 silly lifecycle hello-world@0.1.0~serve: Args: [ ‘-c’, ‘vue-cli-service serve’ ]
11 silly lifecycle hello-world@0.1.0~serve: Returned: code: 1 signal: null
12 info lifecycle hello-world@0.1.0~serve: Failed to exec serve script
13 verbose stack Error: hello-world@0.1.0 serve: vue-cli-service serve
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/lib64/node_modules/npm10/node_modules/npm-lifecycle/index.js:304:16)
13 verbose stack at EventEmitter.emit (events.js:182:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/lib64/node_modules/npm10/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:182:13)
13 verbose stack at maybeClose (internal/child_process.js:961:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
14 verbose pkgid hello-world@0.1.0
15 verbose cwd /home/user/hellow-world
16 verbose Linux 4.17.12-1-default
17 verbose argv “/usr/bin/node10” “/usr/bin/npm-default” “run” “serve”
18 verbose node v10.6.0
19 verbose npm v6.1.0
20 error code ELIFECYCLE
21 error errno 1
22 error hello-world@0.1.0 serve: vue-cli-service serve
22 error Exit status 1
23 error Failed at the a@0.1.0 serve script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:10 (4 by maintainers)
I had the same problem. Set the host parameter will solve it. In “package.json” file, set serve parameters like this: “scripts”: { “serve”: “vue-cli-service serve --host 127.0.0.1 --port [some free port]”, “build”: “vue-cli-service build”, “lint”: “vue-cli-service lint” },
Hi everyone, I did have the same issue with lastest version(3.4.1) at the time of this reply and here it is:
The original
package.json
file is like the following:But, after I did what @Yeganloo said, I modified
package.json
file to be like this:After that run
yarn serve
and this worked for me and shall work with you all. Hope this may help anyone facing the same issue. Thanks