npm install的时候出错
报错信息如下,部分
npm ERR! path E:\workspace\form-create\node_modules.staging\
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'E:\workspace\form-create\node_m
odules.staging'
npm ERR! { Error: EPERM: operation not permitted, unlink 'E:\workspace\form-create\nod
e_modules.staging'
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, unlink 'E:\workspace\form-create\n
ode_modules.staging'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'E:\workspace\form-create\node_modules\.staging' },
npm ERR! stack: 'Error: EPERM: operation not permitted, unlink 'E:\workspace\form-create\node_modules\.staging',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'E:\workspace\form-create\node_modules\.staging'
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 ant
ivirus),
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 t
he
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended
).
这应该是没有权限的问题,查找解决方案,有以下几种
1、使用管理员权限打开命令行到项目目录下再安装依赖
2、清除缓存,到C:\Users\账户目录下的,找到并删除.npmrc文件
试了第一种没有作用,最后还是删除了.npmrc文件,重新安装依赖