question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cli-serve can't run on Linux

See original GitHub issue

Version

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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

13reactions
Yeganloocommented, Feb 15, 2019

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” },

4reactions
vzoolcommented, Feb 20, 2019

Hi everyone, I did have the same issue with lastest version(3.4.1) at the time of this reply and here it is:

➜  vue-app git:(master) vue --version
3.4.1

➜  vue-app git:(master) yarn serve   
yarn run v1.9.4
$ vue-cli-service serve
 INFO  Starting development server...
 10% building 4/10 modules 6 active ...rkspace/vue-app/node_modules/url/url.jsevents.js:183
      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo ENOTFOUND linux-7lv9
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:67:26)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

The original package.json file is like the following:

{
  // ...
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
 // ...
}

But, after I did what @Yeganloo said, I modified package.json file to be like this:

{
  // ...
  "scripts": {
    "serve": "vue-cli-service serve --host 127.0.0.1 --port 8080",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
 // ...
}

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to load @webpack-cli/serve - Stack Overflow
I downloaded a project folder from a pluralsight tutorial, when I try to run it with npm start it shows this ...
Read more >
unable to load '@webpack-cli/serve' command - You.com
I am trying to run the "npm run dev" on my Mac but facing the below errors. I have already fixed the webpack...
Read more >
ng serve - Angular
Option Description Value Type Default Value ‑‑hmr Enable hot module replacement. boolean false ‑‑host Host to listen on. string localhost ‑‑open Opens the url in default...
Read more >
What makes OSX programs not runnable on Linux?
First of all OSX uses a different binary format than Linux, so Linux can't execute binaries compiled for OSX (the same way it...
Read more >
webpack-cli - npm
CLI for webpack & friends. Latest version: 5.0.1, last published: 23 days ago. Start using webpack-cli in your project by running `npm i ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found