npm安装之npmrc错误

今天在安装vue-cli时,报了如下的错误,各种问题,各种博客,都说权限

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

网上百度最多的就是权限问题,报的错误也提示权限问题.


图片.png

这里也在提示权限问题,看他的,就错了!!!

本质是缓存的问题.需要删除npmrc文件.
注意:
不是nodejs安装目录npm模块下的那个npmrc文件
而是在C:\Users{用户}\下的.npmrc文件..

图片.png

将这个文件删除后,清除一下缓存


图片.png

然后再执行 npm i -g @vue/cli


图片.png

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

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 33、JS中的本地存储 把一些信息存储在当前浏览器指定域下的某一个地方(存储到物理硬盘中)1、不能跨浏览器传输:在...
    萌妹撒阅读 2,232评论 0 2
  • NPM笔记: 名字的含义: 1、是Node的开放式模块登记和管理系统 2、Node默认的模块管理器,是一个命令行下...
    名字神马的都是浮云阅读 1,025评论 0 3
  • 什么是 NPM npm之于Node,就像pip之于Python,gem之于Ruby,composer之于PHP。 ...
    ihoey阅读 6,349评论 2 36
  • import java.util.ArrayList; public class ByReference { }c...
    神坛下的我阅读 229评论 0 0
  • 原创: 你兽爷 兽楼处 今天 2006年9月16日,一架直升机缓缓降落在印尼雅加达SENAYAN体育场中央,一位中...
    瞰川阅读 333评论 0 1

友情链接更多精彩内容