npm安裝之npmrc錯(cuò)誤

今天在安裝vue-cli時(shí),報(bào)了如下的錯(cuò)誤,各種問題,各種博客,都說權(quán)限

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated mkdirp@0.5.4: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN tarball tarball data for typescript@~3.7.5 (sha1-BpLiH2X9QQi5MwI4qsEd0uF3oa4=) seems to be corrupted. Trying one more time.
npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path C:\Users\Cheng Feng\AppData\Roaming\npm\node_modules\.staging\typescript-e7a1b473\lib\typescriptServices.js
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\Cheng Feng\AppData\Roaming\npm\node_modules\.staging\typescript-e7a1b473\lib\typescriptServices.js'
npm ERR!  [OperationalError: EPERM: operation not permitted, unlink 'C:\Users\Cheng Feng\AppData\Roaming\npm\node_modules\.staging\typescript-e7a1b473\lib\typescriptServices.js'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, unlink 'C:\Users\Cheng Feng\AppData\Roaming\npm\node_modules\.staging\typescript-e7a1b473\lib\typescriptServices.js'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'unlink',
npm ERR!     path: 'C:\\Users\\Cheng Feng\\AppData\\Roaming\\npm\\node_modules\\.staging\\typescript-e7a1b473\\lib\\typescriptServices.js'
npm ERR!   },
npm ERR!   stack: "Error: EPERM: operation not permitted, unlink 'C:\\Users\\Cheng Feng\\AppData\\Roaming\\npm\\node_modules\\.staging\\typescript-e7a1b473\\lib\\typescriptServices.js'",
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path: 'C:\\Users\\Cheng Feng\\AppData\\Roaming\\npm\\node_modules\\.staging\\typescript-e7a1b473\\lib\\typescriptServices.js',
npm ERR!   parent: '@vue/cli'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
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!     C:\Users\Cheng Feng\AppData\Roaming\npm-cache\_logs\2020-03-30T08_05_53_100Z-debug.log

網(wǎng)上百度最多的就是權(quán)限問題,報(bào)的錯(cuò)誤也提示權(quán)限問題.


圖片.png

這里也在提示權(quán)限問題,看他的,就錯(cuò)了!!!

本質(zhì)是緩存的問題.需要?jiǎng)h除npmrc文件.
注意:
不是nodejs安裝目錄npm模塊下的那個(gè)npmrc文件
而是在C:\Users{用戶}\下的.npmrc文件..

圖片.png

將這個(gè)文件刪除后,清除一下緩存


圖片.png

然后再執(zhí)行 npm i -g @vue/cli


圖片.png

打完收工!!!搞定!!!

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 33、JS中的本地存儲(chǔ) 把一些信息存儲(chǔ)在當(dāng)前瀏覽器指定域下的某一個(gè)地方(存儲(chǔ)到物理硬盤中)1、不能跨瀏覽器傳輸:在...
    萌妹撒閱讀 2,246評(píng)論 0 2
  • NPM筆記: 名字的含義: 1、是Node的開放式模塊登記和管理系統(tǒng) 2、Node默認(rèn)的模塊管理器,是一個(gè)命令行下...
    名字神馬的都是浮云閱讀 1,051評(píng)論 0 3
  • 什么是 NPM npm之于Node,就像pip之于Python,gem之于Ruby,composer之于PHP。 ...
    ihoey閱讀 6,367評(píng)論 2 36
  • import java.util.ArrayList; public class ByReference { }c...
    神壇下的我閱讀 230評(píng)論 0 0
  • 原創(chuàng): 你獸爺 獸樓處 今天 2006年9月16日,一架直升機(jī)緩緩降落在印尼雅加達(dá)SENAYAN體育場中央,一位中...
    瞰川閱讀 334評(píng)論 0 1

友情鏈接更多精彩內(nèi)容