原文:https://blog.csdn.net/weixin_41715295/article/details/79508104

这几天使用npm install时一直报错-4048 operation not permitted,也尝试了多种方法,终于使问题得到解决,这里总结几种方法,先贴图: 

一:权限问题

首先看到operation not permitted我们能想到权限问题,所以这时候我们可以以管理员身份运行cmd或者直接快捷键Win+X来打开。

二:依赖包错误

如上图,根据错误日志我们可以明显看到这个错误minimatch版本过低和dashdash错误,我们只要全局安装好这两个包问题就可以得到完美解决。 
当我们在npm install或者通过npm install安装好一些脚手架如vue-cli或者angular-cli等,而后构建项目时报错,我们可以通过错误提示正确全局安装好所需要的依赖包就好了。 
一般在这种情况下我们需要重点看operation not permitted后面这个关键单词和后面的目录。

三:npm版本问题

npm最新版本5.4.0在安装包时有些缺少依赖包,这种情况就需要我们安装低一点的npm版本:npm i -g npm@5.3.0(这里填写你需要的指定版本)。


以上是个人根据自己遇到情况总结的一些方法,当然重点在看自己的错误日志提示。

使用npm install报错- operation not permitted解决的更多相关文章

  1. 执行npm install报错:npm ERR! code EINTEGRITY

    命令行执行npm install报错如下: D:\frontend\viewsdev>npm install npm ERR! code EINTEGRITY npm ERR! sha512-8 ...

  2. npm install 报错:node-pre-gyp ERR! 问题解决

    npm install报错问题解决 问题: E:\CodeSpace\GitlabTest\desktop>npm install > lifeccp-desktop@1.1.9 post ...

  3. npm install 报错 error Unexpected end of JSON input while parsing near '...sShrinkwrap":false,"d' 解决办法

    npm install 报错 : error Unexpected end of JSON input while parsing near '...sShrinkwrap":false,& ...

  4. 在运行vue项目时,执行npm install报错小记

    在运行vue项目时,执行npm install 报错,导致后续的执行报各种错误,根据报错,尝试了网上的各种办法,最后发现时网络问题下载失败导致,解决办法: 安装cnpm==>npm instal ...

  5. npm install 报错解决办法

    npm install 报错解决办法 原因是因为node_modules可能有意外改动,导致依赖库不完整,删除项目下的node_modules,在你的项目目录下,重新执行npm install,这会重 ...

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

    npm ERR! path E:\SouthernPowerGridProject\web_project\AutoOPS\autoops\node_modules\fsevents\node_mod ...

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

    npm升级后,npm install 报错了,报错信息:ERR! code EINTEGRITY到处百度搜索解决方案,终于找到了!“npm cache verify”这条命令帮助了不少人 npm ca ...

  8. npm install报错类似于npm WARN tar ENOENT: no such file or directory, open '***\node_modules\.staging\***

    报错类似于如下图 解决方法: 删除文件 package-lock.json,再重新执行npm i或者npm install

  9. 前端vue项目执行npm install 报错cd() never called()

    前端我刚开始接触Vue,从GitHub上下载了代码程序,但缺少一些插件,用vscode打开并下载插件执行报错cd() never called! 解决的方式 1.执行cmd命令行不要再vscode里执 ...

随机推荐

  1. python脚本10_打印斐波那契数列的第101项

    #打印斐波那契数列的第101项 a = 1 b = 1 for count in range(99): a,b = b,a+b else: print(b) 方法2: #打印斐波那契数列的第101项 ...

  2. python脚本7_打印九九乘法表

    #打印九九乘法表 for i in range(1,10): s = "" for j in range(1,i+1): s += str(j) + '*' + str(i) + ...

  3. server2012/win8 卸载.net framework 4.5后 无法进入系统桌面故障解决

    故障:服务器装的是windows2012 standard(2012版本从低到高依次为Foundation.Essentials.StandardDatacenter,以及它们的升级版R2),由于要安 ...

  4. 1-25-循环控制符break、continue和函数详解

    大纲: 1-for循环补充 1-1-for循环实战---类C格式应用 2-break.continue循环控制符 2-1实战:帮助理解break.continue作用 3-函数详解 3-1.脚本文件中 ...

  5. MySQL相关问题总结

    希望此贴能够将MySQL安装周围的问题总结清楚,也免得自己再遇到问题时而不知所措.本帖中所有关于MySQL的问题均涉及到两个平台:Ubuntu 和 Windows(本人没有Mac) 问题1:MySQL ...

  6. python高级内置函数和各种推导式的介绍:一行搞定的代码

    一.知识要点 all 都为真 any 有真的 min 最小的 max 最大的 sum 求和 reversed 反转 sorted 排序 zip 对应合并 [] 列表推倒式 () 生成器 {} 字典推倒 ...

  7. SSM整合AOP,日志框架和拦截器

    前言 日志是所有系统必不可少的部分,而AOP在MVC通常用于监控方法调用,可以生成一个traceid,记录从用户调用到底层数据库的数据链路,帮助监控和排查问题. AOP 现在做一个简单的前置切面,用来 ...

  8. 通过消费者和生产者的多线程程序,了解Java的wait()和notify()用法

    仓库类 public class Store { private int size = 0;//当前容量 private final int MAX = 10;//最大容量 //向仓库中增加货物 pu ...

  9. LeetCode OJ:Letter Combinations of a Phone Number(数字字母组合)

    Given a digit string, return all possible letter combinations that the number could represent. A map ...

  10. 【ecmascript】Javascript 严格模式详解【转】

    一.概述 除了正常运行模式,ECMAscript 5添加了第二种运行模式:"严格模式"(strict mode).顾名思义,这种模式使得Javascript在更严格的条件下运行. ...