【问题标题】:How to fix "This is probably not a problem with npm. There is likely additional logging output above." error?如何解决“这可能不是 npm 的问题。上面可能有额外的日志输出。”错误?
【发布时间】:2019-08-30 06:27:24
【问题描述】:

我正在尝试使用 Vue CLI 创建一个项目。但是我收到了这个错误信息:

      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo ENOTFOUND x86_64-apple-darwin13.4.0
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:58:26)
Emitted 'error' event at:
    at GetAddrInfoReqWrap.doListen [as callback] (net.js:1440:12)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:58: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!     /Users/jeong-ugim/.npm/_logs/2019-04-09T03_17_05_336Z-debug.log

我只是按照“https://cli.vuejs.org/guide/installation.html”上的安装步骤进行操作。我做了npm install -g @vue/clivue create hello-world。我一提交npm run serve,错误消息就出现了。我查看了错误日志,但找不到导致问题的原因。

我尝试更新 npm。我只是找不到我的计算机或代码有什么问题。

我该如何解决这个问题?感谢您的任何帮助或建议。

这是错误日志。

0 info it worked if it ends with ok
1 verbose cli [ '/Users/jeong-ugim/.nvm/versions/node/v11.12.0/bin/node',
1 verbose cli   '/Users/jeong-ugim/.nvm/versions/node/v11.12.0/bin/npm',
1 verbose cli   'run',
1 verbose cli   'serve' ]
2 info using npm@6.7.0
3 info using node@v11.12.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: /Users/jeong-ugim/.nvm/versions/node/v11.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/jeong-ugim/Programming/hello-world/node_modules/.bin:/Users/jeong-ugim/.nvm/versions/node/v11.12.0/bin:/Users/jeong-ugim/anaconda3/bin:/Users/jeong-ugim/anaconda3/condabin:/Users/jeong-ugim/anaconda/bin:/Users/jeong-ugim/anaconda/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/jeong-ugim/anaconda/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
9 verbose lifecycle hello-world@0.1.0~serve: CWD: /Users/jeong-ugim/Programming/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> (/Users/jeong-ugim/.nvm/versions/node/v11.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:197:13)
13 verbose stack     at ChildProcess.<anonymous> (/Users/jeong-ugim/.nvm/versions/node/v11.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:197:13)
13 verbose stack     at maybeClose (internal/child_process.js:988:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
14 verbose pkgid hello-world@0.1.0

【问题讨论】:

  • 你可以在这里添加你的 package.json 的“脚本”部分吗?
  • 可能是安装问题。如果您的系统中有 Vue CLI 2,您必须将其完全删除,然后安装第三版 CLI。猜猜这个链接(github.com/serverless/serverless/issues/5133)中提到的节点版本问题。试试这些,看看问题是否解决了

标签: vue.js npm


【解决方案1】:

在我的例子中,我有一个复杂的文件夹名称 (12.abc-def &amp; Workflow blah blah.) => 我使用了一个普通的文件夹名称,它按预期工作。

【讨论】:

    【解决方案2】:

    谢谢@Riddhi 和@WebMan。我通过将 auto_activate_base 设置为 False 解决了我的问题。

    这是我使用的代码:conda config --set auto_activate_base False

    我仍然不明白为什么我需要在终端提示符前禁用 (base)。但似乎一切正常。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-27
      • 1970-01-01
      • 2020-11-16
      • 2021-02-13
      • 2020-05-10
      • 2020-09-11
      • 2020-10-13
      • 1970-01-01
      相关资源
      最近更新 更多