npm install报错 npm ERR! enoent ENOENT: no such file or directory
2017-12-13 00:32
671 查看
在npm之后出现如下错误:
关于这个错误,网上有很多解决方法,但是都不适用在我这里。
然后 ls 了一下这个文件, 得到如下结果:
可以看到这个是一个软连接,链接到 _follow-redirects@1.2.6@follow-redirects 这个上面,很明显,在这个目录是没有follow-redirects 这个东西的。
怎么办呢? 很简单 npm install follow-redirects 把这个东西安装上去就好了。
安装完成之后, 再 ls 一把
可以看到已经有了。
然后在 npm install 就没有错了。
$ 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 就没有错了。
相关文章推荐
- cnmp安装失败,报错npm ERR! enoent ENOENT: no such file or directory,
- cnmp安装失败,报错npm ERR! enoent ENOENT: no such file or directory,
- npm WARN enoent ENOENT: no such file or directory, open 'D:\web\Imooc\package.json' npm WARN Imooc
- npm WARN enoent ENOENT: no such file or directory, open 'E:\Program Files\nodejs \package.json' npm
- vue 安装完新的插件后,报错errno -4058,enoent ENOENT: no such file or directory,找不到node_modules下面的文件
- npm WARN enoent ENOENT: no such file or directory, open 'E:\Program Files\nodejs \package.json' npm
- npm WARN enoent ENOENT: no such file or directory, open 'E:\Program Files\nodejs \package.json' npm
- Linux 格式化分区 报错Could not stat --- No such file or directory 和 partprobe 命令
- Shell脚本报错:-bash: ./switch.sh: /bin/bash^M: bad interpreter: No such file or directory
- Shell脚本报错:-bash: ./switch.sh: /bin/bash^M: bad interpreter: No such file or directory
- 执行shell脚本报错:bin/sh^M: bad interpreter: No such file or directory
- error opening trace file: No such file or directory (2)报错原因
- ubuntu12.04 报错curses.h: No such file or directory
- npm WARN enoent ENOENT: no such file or directory, open 'E:\Program Files\nodejs \package.json' npm
- Linux 格式化分区 报错Could not stat --- No such file or directory 和 partprobe 命令
- Linux 格式化分区 报错Could not stat --- No such file or directory 和 partprobe 命令
- 解决gradle /Users/xxxx/Documents/workspace/fontmanager/.gradle/2.2.1/taskArtifacts/cache.properties (No such file or directory)报错办法
- npm install命令运行中出现Error: ENOENT: no such file or directory解决方法
- shell脚本报错:-bash: xxx: /bin/sh^M: bad interpreter: No such file or directory --引用自http://blog.csdn.net/xiaaiwu/article/details/49126777
- centos启动zookeeper报错:No such file or directory FAILED TO WRITE PID