首页 > 其他分享 >安装vue脚手架出现错误:npm ERR code ETIMEDOUT npm ERR syscall connect

安装vue脚手架出现错误:npm ERR code ETIMEDOUT npm ERR syscall connect

时间:2022-12-05 14:03:05浏览次数:38  
标签:npm vue ERR package cache server apollo

npm安装淘宝映像报npm ERR!

具体如下

C:\Users\admin>npm install -g @vue/cli
npm ERR! code ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npm.taobao.orge/@vue%2fcli failed, reason: getaddrinfo ENOTFOUND registry.npm.taobao.orge
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR! D:\develop_soft\nodejs\node_cache\_logs\2022-11-28T09_24_21_045Z-debug-0.log


解决办法:


1.设置代理关闭

npm config set proxy false

2.清除缓存

npm cache clean

若是清除缓存时报错,如下所示:

npm ERR! As of npm@5, the npm cache self-heals from corruption issues
npm ERR! by treating integrity mismatches as cache misses. As a result,
npm ERR! data extracted from the cache is guaranteed to be valid. If you
npm ERR! want to make sure everything is consistent, use `npm cache verify`
npm ERR! instead. Deleting the cache can only make npm go slower, and is
npm ERR! not likely to correct any problems you may be encountering!
npm ERR!
npm ERR! On the other hand, if you're debugging an issue with the installer,
npm ERR! or race conditions that depend on the timing of writing to an empty
npm ERR! cache, you can use `npm install --cache /tmp/empty-cache` to use a
npm ERR! 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
npm ERR! with --force.


就使用下面命令:

npm cache clean --force

若是显示
npm WARN using --force Recommended protections disabled.
那就说明需要降低npm的版本了,因为安装的npm版本过高
降低npm的命令使用如下

npm install [email protected] -g


最终设置淘宝镜像

npm config set registry https://registry.npm.taobao.org

查看上面配置的配置信息

npm config list

​​安装vue脚手架出现错误:npm ERR code ETIMEDOUT npm ERR syscall connect_Server​​


再重新安装 Vue/cli

​​安装vue脚手架出现错误:npm ERR code ETIMEDOUT npm ERR syscall connect_perl_02​​



Microsoft Windows [版本 10.0.19045.2251]
(c) Microsoft Corporation。保留所有权利。

C:\Users\admin>npm install -g @vue/cli
npm ERR! code ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npm.taobao.orge/@vue%2fcli failed, reason: getaddrinfo ENOTFOUND registry.npm.taobao.orge
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR! D:\develop_soft\nodejs\node_cache\_logs\2022-11-28T09_24_21_045Z-debug-0.log

C:\Users\admin>npm config set proxy false

C:\Users\admin>npm cache clean
npm ERR! As of npm@5, the npm cache self-heals from corruption issues
npm ERR! by treating integrity mismatches as cache misses. As a result,
npm ERR! data extracted from the cache is guaranteed to be valid. If you
npm ERR! want to make sure everything is consistent, use `npm cache verify`
npm ERR! instead. Deleting the cache can only make npm go slower, and is
npm ERR! not likely to correct any problems you may be encountering!
npm ERR!
npm ERR! On the other hand, if you're debugging an issue with the installer,
npm ERR! or race conditions that depend on the timing of writing to an empty
npm ERR! cache, you can use `npm install --cache /tmp/empty-cache` to use a
npm ERR! 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
npm ERR! with --force.

npm ERR! A complete log of this run can be found in:
npm ERR! D:\develop_soft\nodejs\node_cache\_logs\2022-11-29T02_10_05_159Z-debug-0.log

C:\Users\admin>npm cache clean --force
npm WARN using --force Recommended protections disabled.

C:\Users\admin>npm install [email protected] -g
npm ERR! code ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npm.taobao.orge/npm failed, reason: getaddrinfo ENOTFOUND registry.npm.taobao.orge
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR! D:\develop_soft\nodejs\node_cache\_logs\2022-11-29T02_10_57_244Z-debug-0.log

C:\Users\admin>npm config set registry https://registry.npm.taobao.org

C:\Users\admin>npm config list
; "builtin" config from D:\develop_soft\nodejs\node_modules\npm\npmrc

; prefix = "C:\\Users\\admin\\AppData\\Roaming\\npm" ; overridden by user

; "user" config from C:\Users\admin\.npmrc

cache = "D:\\develop_soft\\nodejs\\node_cache"
prefix = "D:\\develop_soft\\nodejs\\node_global"
proxy = false
registry = "https://registry.npm.taobao.org/"

; node bin location = D:\develop_soft\nodejs\node.exe
; node version = v18.12.1
; npm local prefix = C:\Users\admin
; npm version = 8.19.2
; cwd = C:\Users\admin
; HOME = C:\Users\admin
; Run `npm config ls -l` to show all defaults.

C:\Users\admin>npm install -g @vue/cli
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: The `apollo-datasource` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.
npm WARN deprecated [email protected]: The `apollo-server-errors` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.
npm WARN deprecated [email protected]: The `apollo-server-plugin-base` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.
npm WARN deprecated [email protected]: The `apollo-server-types` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.
npm WARN deprecated [email protected]: The `apollo-server-express` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.
npm WARN deprecated [email protected]: The `apollo-reporting-protobuf` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/usage-reporting-protobuf` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.
npm WARN deprecated [email protected]: The `apollo-server-env` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/utils.fetcher` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.
npm WARN deprecated [email protected]: The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md
npm WARN deprecated [email protected]: The `apollo-server-core` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.

added 849 packages in 4m

C:\Users\admin>




为人:谦逊、激情、博学、审问、慎思、明辨、 笃行
学问:纸上得来终觉浅,绝知此事要躬行
为事:工欲善其事,必先利其器。
态度:道阻且长,行则将至;行而不辍,未来可期
.....................................................................
------- 换了个头像,静静的想,默默的思恋,一丝淡淡的忧伤 ----------
------- 桃之夭夭,灼灼其华。之子于归,宜其室家。 ---------------
------- 桃之夭夭,有蕡其实。之子于归,宜其家室。 ---------------
------- 桃之夭夭,其叶蓁蓁。之子于归,宜其家人。 ---------------
=====================================================================
转载请标注出处!



标签:npm,vue,ERR,package,cache,server,apollo
From: https://blog.51cto.com/ios9/5912013

相关文章