原文: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. Angular2 中的依赖包详解

    转自:http://blog.csdn.net/feiying008/article/details/53033704 目录 dependencies 和 devDependencies depend ...

  2. 设置ListBox的Item的样式

    <ListBox.ItemContainerStyle>                <Style TargetType="Control">       ...

  3. 转载:Object的create方法文档

    源地址:https://developer.mozilla.org/zh-CN/docs/JavaScript/Reference/Global_Objects/Object/create#.E4.B ...

  4. 练习-99乘法表 token生成器 翻译小工具

    一.99乘法表 1.1 技术点 记住: for 循环的使用,以及for的嵌套使用 range()的使用,掌握sep为负数的使用的使用. print() 函数的使用,默认的结尾的换行符 替换 end= ...

  5. JDK的BIO, NIO, AIO

    背景知识点我 1. BIO JDK5之前, JDK的IO模式只有BIO(同步阻塞)问题: 因为阻塞的存在, 需对每个请求开启一个线程. 过多的线程切换影响操作系统性能解决: 使用线程池, 处理不过来的 ...

  6. pulltoRefresh类图

  7. Datesheet 参数手册

    1 明白P/N每一个字是代表什么含义... 这很重要! EP6095-01-381 (CL10C010CBNNNC=CL10C010CB8NNNC ?)----8 代表Ni plating in te ...

  8. c# 处理js序列化时 datetime返回UTC格式的问题

    using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using Syst ...

  9. Leetcode 590. N-ary Tree Postorder Traversal

    DFS,递归或者栈实现. """ # Definition for a Node. class Node: def __init__(self, val, childre ...

  10. nodejs——js 实现webSocket 兼容移动端

    nodejs——js 实现webSocket 兼容移动端 //服务器端 //npm install --save ws const express = require('express'); cons ...