我正在尝试使用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/cli
和vue 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
答案 0 :(得分:1)
谢谢@Riddhi和@WebMan。我通过将auto_activate_base
设置为False解决了我的问题。
这是我使用的代码:conda config --set auto_activate_base False
我仍然不明白为什么我需要在终端提示前禁用(基本)。但是一切似乎都正常。
答案 1 :(得分:0)
就我而言,我有一个复杂的文件夹名称 (12.abc-def & Workflow blah blah.)
=> 我使用了一个普通的文件夹名称,它按预期工作。