npm安装之npmrc错误

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

npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: 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 [email protected]: 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

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

你可能感兴趣的:(npm安装之npmrc错误)