安裝@vue/cli 報錯npm WARN deprecated [email protected]問題

安裝@vue/cli 報錯npm WARN deprecated [email protected]

產生錯誤的原因

是電腦資源的問題,電腦裡面沒有配置淘寶鏡像

解決步驟

  • 配置淘寶鏡像:npm config set registry https://registry.npm.taobao.org
  • 配置完鏡像之後驗證是否成功:npm config get registry

圖示如下:

配置完後問題就解決瞭!!!

以下附上VueCli的安裝方法

下載VueCli,命令行輸入npm i -g @vue/cli

下載成功,檢查下載的版本vue --version(我下載的是4.2.3版本的)

vue/cli 安裝出錯的解決

安裝vue-cli出錯

D:\code\vue_code>npm install -g @vue/cli
npm ERR! code EINTEGRITY
npm ERR! path C:\Users\xxx\AppData\Local\npm-cache\_cacache\content-v2\sha512\f5\32\605bc70f6f0383c6babf834c59f8b26e5944061f77b86774c8b267c115496e57205801bde1328607527963daab39d70a21084aea54197155e4c264473ecb
npm ERR! errno EINTEGRITY
npm ERR! Invalid response body while trying to fetch https://registry.npm.taobao.org/slash: Integrity verification failed for sha512-9TJgW8cPbwODxrq/g0xZ+LJuWUQGH3e4Z3TIsmfBFUluVyBYAb3hMoYHUnlj2qs51wohCErqVBlxVeTCZEc+yw== (C:\Users\xxx\AppData\Local\npm-cache\_cacache\content-v2\sha512\f5\32\605bc70f6f0383c6babf834c59f8b26e5944061f77b86774c8b267c115496e57205801bde1328607527963daab39d70a21084aea54197155e4c264473ecb)
 
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\xxx\AppData\Local\npm-cache\_logs\2021-12-13T11_46_52_646Z-debug-0.log

解決

清除緩存:

npm cache clear --force

重新安裝:

D:\code\vue_code>npm cache clear –force
npm WARN using –force Recommended protections disabled.
 
D:\code\vue_code>npm install -g @vue/cli
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]: this library is no longer supported
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: The `graphql-extensions` API has been removed from Apollo Server 3. Use the plugin API instead: https://www.apollographql.com/docs/apollo-server/integrations/plugins/
npm WARN deprecated [email protected]: The `apollo-tracing` package is no longer part of Apollo Server 3. See https://www.apollographql.com/docs/apollo-server/migration/#tracing for details
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: The functionality provided by the `apollo-cache-control` package is built in to `apollo-server-core` starting with Apollo Server 3. See https://www.apollographql.com/docs/apollo-server/migration/#cachecontrol for details.
npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/address'
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: Switch to 'npm install joi'
npm WARN deprecated [email protected]: This package has been deprecated and now it only exports makeExecutableSchema.\nAnd it will no longer receive updates.\nWe recommend you to migrate to scoped packages such as @graphql-tools/schema, @graphql-tools/utils and etc.\nCheck out https://www.graphql-tools.com to learn what package you should use instead
 
added 952 packages in 2m
 
13 packages are looking for funding
  run `npm fund` for details

總結

以上為個人經驗,希望能給大傢一個參考,也希望大傢多多支持WalkonNet。

推薦閱讀: