在npm之后出现如下错误:

$ npm install
npm WARN checkPermissions Missing write access to /Users/lucas/code/js/vue/train/vue-sample/node_modules/follow-redirects
npm ERR! path /Users/lucas/code/js/vue/train/vue-sample/node_modules/follow-redirects
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access '/Users/lucas/code/js/vue/train/vue-sample/node_modules/follow-redirects'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent npm ERR! A complete log of this run can be found in:
npm ERR! /Users/lucas/.npm/_logs/2017-12-12T16_03_34_223Z-debug.log

关于这个错误,网上有很多解决方法,但是都不适用在我这里。

解决方法

从错误来看, 是 /Users/lucas/code/js/vue/train/vue-sample/node_modules/follow-redirects 这个文件没有权限或者没有找到。

然后 ls 了一下这个文件, 得到如下结果:

$ ls -lt | grep follow-redirects
lrwxr-xr-x 1 lucas staff 40 12 12 23:39 follow-redirects -> _follow-redirects@1.2.6@follow-redirects

可以看到这个是一个软连接,链接到 _follow-redirects@1.2.6@follow-redirects 这个上面,很明显,在这个目录是没有follow-redirects 这个东西的。

怎么办呢? 很简单 npm install follow-redirects 把这个东西安装上去就好了。

安装完成之后, 再 ls 一把

$ ls -lt | grep follow
drwxr-xr-x 10 lucas staff 320 12 13 00:22 _follow-redirects@1.2.6@follow-redirects
lrwxr-xr-x 1 lucas staff 40 12 12 23:39 follow-redirects -> _follow-redirects@1.2.6@follow-redirects

可以看到已经有了。

然后在 npm install 就没有错了。

npm install报错 npm ERR! enoent ENOENT: no such file or directory的更多相关文章

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

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

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

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

  3. 『奇葩问题集锦』npm install 报错 node-pre-gyp ERR! node-pre-gyp -v v0.6.25

    gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you ...

  4. 输入npm install 报错npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! node-sass@4.13.1 postinstall: `node scripts/build.js`

    输入npm install 报以下错误 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! node-sass@4.13.1 postinstall: ...

  5. npm install报错npm ERR! Maximum call stack size exceeded解决

    给npm降级或者升级 比如: 降级 : npm install -g npm@6.1.0 升级 : npm install -g npm  升级到最新版

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

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

  7. 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,& ...

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

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

  9. npm install 报错解决办法

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

随机推荐

  1. MQTT详解以及在IoT中的应用

    MQTT定义: MQTT(Message Queuing Telemetry Transport,消息队列遥测传输)是IBM开发的一个即时通讯协议,有可能成为物联网的重要组成部分.该协议支持所有平台, ...

  2. LeetCode题解之Insert into a Binary Search Tree

    1.题目描述 2.分析 插入算法. 3.代码 TreeNode* insertIntoBST(TreeNode* root, int val) { insert(root, val); return ...

  3. jquery判断checkBox的checked

    jquery判断checked的三种方法:.attr('checked):   //看版本1.6+返回:”checked”或”undefined” ;1.5-返回:true或false.prop('c ...

  4. 彻底卸载删除Win10易升,禁止再生

    易升是微软推出的win10升级工具.用户可通过易升一键升级win10. 因为我的电脑已经是win10的系统,所以我也不需要升级.也不想升级,因为我从网上了解到升级后的系统反而没有升级前的好用. 微软的 ...

  5. Linux运维面试题之--网页打开缓慢如何优化

    服务器负载过高或者网页打开缓慢,简单说说你的优化思路 ? 首先我们要发现问题的过程,通过操作系统,数据库,程序设计,硬件角度四个维度找到问题所在 找到瓶颈点的位置 制定好优化方案,形成处理问题的体系 ...

  6. 【Beta阶段】测试报告

    兼容性测试   功能 描述 效果 Chrome浏览器 FireFox浏览器 IE浏览器 搜狗浏览器 主页实用小工具按钮 跳转到实用小工具首页 跳转到实用小工具首页 ü ü ü ü 鼠标移动到逐差法计算 ...

  7. 1024. Video Stitching

    //使用java dfs public int videoStitching(int[][] clips, int T) { //bfs Queue<Integer> queue = ne ...

  8. div放在li标签中,无法撑开li标签的问题

    作为一个前端菜鸟,我又碰到问题了,今天把div放到li标签中,发现div并没有把li标签撑开,而是在li标签边界之外,具体情况如下图所示: 那么,怎样才能达到预期的效果(每个li中放置一个div标签, ...

  9. IE8以下兼容

    <!--[if lt IE 9]><script type="text/javascript">alert('IE版本太低,请升级后使用');</sc ...

  10. P1019 单词接龙

    单词接龙是一个与我们经常玩的成语接龙相类似的游戏,现在我们已知一组单词,且给定一个开头的字母,要求出以这个字母开头的最长的“龙”(每个单词都最多在“龙”中出现两次),在两个单词相连时,其重合部分合为一 ...