输入npm run dev 命令时出现:以下错误
npm ERR! code EPERM
npm ERR! syscall open
npm ERR! path D:\dev\nodejs\node_cache\_cacache\tmp\5b622c44
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, open 'D:\dev\nodejs\node_cache\_cacache\tmp\5b622c44'
npm ERR! [Error: EPERM: operation not permitted, open 'D:\dev\nodejs\node_cache\_cacache\tmp\5b622c44'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'D:\\dev\\nodejs\\node_cache\\_cacache\\tmp\\5b622c44'
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.
1.在网上找解决办法修改了C:\Users{账户}\下的.npmrc文件,选择将隐藏取消掉发现运行还是报原来的错
原来
修改后
运行还是报错
2.后来发现是权限的问题
nodojs的文件中的模块操作权限不够
解决方案:
找到你安装node.js的文件夹
点击应用保存
再运行就没有错误了