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

编程入门 行业动态 更新时间:2024-10-27 02:18:14
本文介绍了npm:ENOENT:没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用npm 3.3.6,当我尝试安装一堆模块时,出现以下错误:

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

我不知道这里发生了什么或具体是哪个模块导致了此问题.我可以看到它涉及到babel-cli,chokidar和ans1,但是当我单独安装babel-cli时,它可以正常工作而不会出现错误.

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.

推荐答案

我看到了类似的问题.当node_modules目录存在并且您运行npm install时,会导致此问题.有一些名称冲突.如果删除node_modules目录,则不会出现问题.

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.

更多推荐

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

本文发布于:2023-11-24 11:40:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1625051.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   目录   npm   ENOENT

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!