本人小白,在VScode终端中进行npm install,报错,如下

PS E:\SVN\学生管理系统\代码\crqms\crqms-web> npm install
npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path D:\Program Files (x86)\nodejs\node_cache\_locks
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'D:\Program Files (x86)\nodejs\node_cache\_locks'
npm ERR!  [Error: EPERM: operation not permitted, mkdir 'D:\Program Files (x86)\nodejs\node_cache\_locks'] {
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'mkdir',
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.


找了好多办法,依然解决不了我的问题,根据上面的提示,我没有获得管理员权限,

于是,打开VScode用管理员身份打开,可是这样每次都这样,好麻烦。放弃这种方法

废话不说了,我的解决办法如下:

  1. 找到本机的node安装目录,我的目录是:D:\Program Files (x86)\nodejs
  2. 随意右击nodejs中的一个文件,观察它的删除和重命名,发现前面有个盾牌,如下所示
  3. 这个盾牌意思是需要管理员权限的,普通用户是没有它的所有权限,所以我们需要给普通用户添加管理员一样的权限
  4. 右击nodejs文件夹,点击属性 
  5. 点击安全                                                               
  6. 点击编辑                                                   

将这些权限都勾选上,点击“应用”,出现如下:

点击“确定”后,在打开原来的nodejs文件夹,右键查看,发现已经没有盾牌了

再到VScode中进行npm install

成功解决了

VScode中npm install报错相关推荐

  1. vscode输入npm install报错

    vscode输入npm install报错 主问题 时间:2021.12.04 问题描述:安装node.js后,在vscode控制台中输入npm install报出错误如下图: 问题根因:需要用管理员 ...

  2. npm install报错:This version of npm is compatible with lockfileVersion@1, but package-lock.json was ge

    npm install报错:This version of npm is compatible with lockfileVersion@1, but package-lock.json was ge ...

  3. 关于npm install报错

    我是刚学得vue,现在刚刚下载了node镜像,在最后第二步得时候报错了,npm install报错,说我得packlock.json有问题,我得步骤是这样得 1.全局安装node镜像,npm inst ...

  4. npm install 报错:xx/git.EXE ls-remote -h -t ssh://git@github.com/sohee-lee7/Squire.git

    npm install 报错:xx/git.EXE ls-remote -h -t ssh://git@github.com/sohee-lee7/Squire.git 网上的教程是这样: git c ...

  5. npm install 报错:ERR! code EINTEGRITY 解决方案

    npm install 报错:ERR! code EINTEGRITY 解决方案 参考文章: (1)npm install 报错:ERR! code EINTEGRITY 解决方案 (2)https: ...

  6. npm install 报错: WARN checkPermissions Missing write access to 解决方案

    npm install 报错: WARN checkPermissions Missing write access to 解决方案 参考文章: (1)npm install 报错: WARN che ...

  7. npm install 报错 npm WARN tar ENOENT: no such file or directory, open... 解决方式

    报错信息 npm install 报错 npm WARN tar ENOENT: no such file or directory, open- 解决方式 使用cnpm install

  8. npm install报错 npm ERR,code ERESOLVE npm ERR,ERESOLVE unable to resolve dependency tree

    文章目录 前言 问题分析 解决方法 转载于 前言 在下载npm时报错npm ERR! code ERESOLVE npm ERR! ERESOLEVE unable to resolve depend ...

  9. npm install 报错(npm ERR! errno -4048,Error: EPERM: operation not permitted,)解决方法

    npm install 报错(npm ERR! errno -4048,Error: EPERM: operation not permitted,)解决方法 参考文章: (1)npm install ...

最新文章

  1. 制作ui设计作品集要注意哪些
  2. 一周成python大神_python大神进阶路线
  3. 直播APP开发:直播人数是否该有限制
  4. 5.hadoop常用命令
  5. Windows系统中文件解说
  6. 疯狂捕鱼之路径解决方案的思考
  7. opencv鼠标操作,画矩形
  8. Linux使用Jexus托管Asp.Net Core应用程序
  9. gis影像格式img转为ecw_医学影像图片格式
  10. 今晚直播丨有关Oracle 19c认证体系的一些变化及备考技巧
  11. java调用webservice_Oracle触发器调用webservice说明
  12. laravel php环境,Laravel 5框架学习之环境与配置
  13. 掌握好这几点方法学习Linux,一定比别人更快入门运维!
  14. 如何学习opencv
  15. Matlab实现人脸识别
  16. openai_ros教程( ros gazebo 深度强化学习)
  17. node.js离线库
  18. 各种门锁的内部结构图_有没有这种执手门锁的内部结构图?
  19. Silverlight Tools 3 安装时发生严重错误
  20. 通过wifi进行adb远程连接手机进行调试

热门文章

  1. 迎难而上 数据库管理员怎样走向成功?(转)
  2. 谷歌插件 XssSniper 扩展介绍 xss检测
  3. 自动驾驶学习过程及资料整理
  4. New运算符干了什么?手写一个new
  5. 一车abs线路怎么量_abs传感器怎么测量好坏
  6. java 输入控制_java控制台输入
  7. dede图片上传php,织梦cms增加栏目(栏目图片)上传缩略图功能
  8. camel标记法是什么方法
  9. 【翻译】Unity2017.3 版本发布说明
  10. 为什么这么多的顶尖黑客来自俄罗斯?