npm mysql enoent,npm:ENOENT:没有这样的文件或目录

在尝试使用npm 3.3.6安装包含babel-cli、chokidar等模块时遇到了ENOENT错误,该错误指出文件或目录不存在。问题源于存在node_modules目录时的命名冲突。解决方案是删除现有node_modules目录后再进行安装,这样可以避免安装过程中出现的文件找不到问题。
摘要由CSDN通过智能技术生成

I'm using npm 3.3.6 and when I try to install a bunch of modules I get the error below:

npm i babel-cli babel-plugin-syntax-async-functions babel-plugin-transform-regenerator babel-polyfill babel-preset-es2015 babelify watchify browserify --save-dev

npm ERR! Darwin 15.0.0

npm ERR! argv "/Users/thomas/.nvm/versions/node/v5.0.0/bin/node" "/Users/thomas/.nvm/versions/node/v5.0.0/bin/npm" "i" "babel-cli" "babel-plugin-syntax-async-functions" "babel-plugin-transform-regenerator" "babel-polyfill" "babel-preset-es2015" "babelify" "watchify" "browserify" "--save-dev"

npm ERR! node v5.0.0

npm ERR! npm v3.3.6

npm ERR! path /Users/thomas/Desktop/esnext-bootstrap/node_modules/babel-cli/node_modules/chokidar/node_modules/fsevents/node_modules/asn1

npm ERR! code ENOENT

npm ERR! errno -2

npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename '/Users/thomas/Desktop/esnext-bootstrap/node_modules/babel-cli/node_modules/chokidar/node_modules/fsevents/node_modules/asn1' -> '/Users/thomas/Desktop/esnext-bootstrap/node_modules/asn1'

npm ERR! enoent This is most likely not a problem with npm itself

npm ERR! enoent and is related to npm not being able to find a file.

npm ERR! enoent

npm ERR! Please include the following file with any support request:

npm ERR! /Users/thomas/Desktop/esnext-bootstrap/npm-debug.log

I have no clue whats going on here or what module specifically is causing the issue. I can see it involves babel-cli, chokidar, and ans1, but when I install babel-cli alone it works without an error.

Just installed every module individually and it worked fine.

解决方案

I am seeing a similar issue. The issue is caused when the node_modules directory exists and you run npm install. There is some name collision. If you remove the node_modules directory you won't have the issue.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值