【问题标题】:npm:ERR! A complete log of this run can be found innpm:错误!此运行的完整日志可在
【发布时间】:2020-09-24 17:56:06
【问题描述】:

我尝试安装 vue cli。但我收到了很多奇怪的错误。我搜索了错误但找不到它们:

linux@admin:~/Masaüstü/learn-vue$ sudo npm install vue -g 






[sudo] password for linux: 
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EAI_AGAIN: request to https://registry.npmjs.org/vue failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org registry.npmjs.org:443
npm WARN registry Using stale data from https://registry.npmjs.org/ due to a request error during revalidation.
+ vue@2.6.12
updated 1 package in 10.676s





linux@admin:~/Masaüstü/learn-vue$ vue --version





'vue'  komutu sistemde bulunamadı. Ama şununla kurulabilir:

sudo snap install vue




linux@admin:~/Masaüstü/learn-vue$ npm i -g @vue/cli





npm ERR! Response timeout while trying to fetch https://registry.npmjs.org/@vue%2fcli-ui-addon-webpack (over 30000ms)

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/linux/.npm/_logs/2020-09-24T17_37_08_787Z-debug.log






linux@admin:~/Masaüstü/learn-vue$ npm i -g vue-cli@2.9.6





npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/vue-cli failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org registry.npmjs.org:443

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/linux/.npm/_logs/2020-09-24T17_40_02_518Z-debug.log




linux@admin:~/Masaüstü/learn-vue$ npm cache clean 





npm ERR! As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead. On the other hand, if you're debugging an issue with the installer, you can use `npm install --cache /tmp/empty-cache` to use a temporary cache instead of nuking the actual one.
npm ERR! 
npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force.
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/linux/.npm/_logs/2020-09-24T17_40_33_560Z-debug.log



linux@admin:~/Masaüstü/learn-vue$ sudo npm cache clean 



npm ERR! As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead. On the other hand, if you're debugging an issue with the installer, you can use `npm install --cache /tmp/empty-cache` to use a temporary cache instead of nuking the actual one.
npm ERR! 
npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-09-24T17_40_40_872Z-debug.log





linux@admin:~/Masaüstü/learn-vue$ sudo npm cache clean --force





npm WARN using --force I sure hope you know what you are doing.





linux@admin:~/Masaüstü/learn-vue$ 

我在互联网上搜索了所有内容,我在许多论坛上提出了问题,但不幸的是我找不到答案。最后,我在这里打开话题希望找到答案。 请大家帮帮我。谢谢

【问题讨论】:

  • 错误reason: getaddrinfo EAI_AGAIN registry.npmjs.org registry.npmjs.org:443 通常与网络相关DNS、防火墙策略等)。

标签: javascript vue.js npm


【解决方案1】:

Vue 为他们的 cli 命名空间(来自 v3)。使用npm i -g @vue/cli

编辑:查看docs 了解更多信息

【讨论】:

  • 哦,谢谢你。我尝试使用 sudo 运行你的命令,这个工作。谢谢你。
【解决方案2】:

这里:

linux@admin:~/Masaüstü/learn-vue$ sudo npm i -g @vue/cli
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/joi@15.1.1: joi is leaving the @hapi organization and moving back to 'joi' (https://github.com/sideway/joi/issues/2411)
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/address@2.1.4: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/@vue/cli/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN @vue/compiler-sfc@3.0.0 requires a peer of vue@3.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules']
npm ERR!   stack:
npm ERR!    'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules' }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/linux/.npm/_logs/2020-09-24T18_13_12_868Z-debug.log
linux@admin:~/Masaüstü/learn-vue$ vue --version

'vue'  komutu sistemde bulunamadı. Ama şununla kurulabilir:

sudo snap install vue

linux@admin:~/Masaüstü/learn-vue$ 

【讨论】:

  • 试试sudo
【解决方案3】:

npm 错误!代码ENOENT npm 错误!系统调用打开 npm 错误!路径 C:\Users\moham/package.json npm 错误!错误号-4058 npm 错误! enoent ENOENT:没有这样的文件或目录,打开 'C:\Users\moham\package.json' npm 错误! enoent 这与 npm 找不到文件有关。 npm 错误!恩恩特

npm 错误!可以在以下位置找到此运行的完整日志: npm 错误! C:\Users\moham\AppData\Local\npm-cache_logs\2021-12-30T09_56_30_171Z-debug.log

【讨论】:

  • 正如目前所写,您的答案尚不清楚。请edit 添加其他详细信息,以帮助其他人了解这如何解决所提出的问题。你可以找到更多关于如何写好答案的信息in the help center
猜你喜欢
  • 2023-03-03
  • 1970-01-01
  • 1970-01-01
  • 2021-04-14
  • 1970-01-01
  • 2015-07-22
  • 2021-11-22
  • 2014-08-03
  • 1970-01-01
相关资源
最近更新 更多