给出相同的错误EISDIR

给出相同的错误EISDIR

本文介绍了NPM卡住,给出相同的错误EISDIR:对目录的非法操作,读取时出错(本机)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无论我在哪个目录中,以及在cmd.exe中的"npm"之后键入什么内容,我都会遇到此错误.这是npm-debug.log:

I am stuck with this error no matter what directory I am in, and what I type after "npm" in cmd.exe. Here is the npm-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js' ]
2 info using [email protected]
3 info using [email protected]
4 verbose stack Error: EISDIR: illegal operation on a directory, read
4 verbose stack     at Error (native)
5 verbose cwd C:\Users\me
6 error Windows_NT 6.1.7601
7 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js"
8 error node v4.2.6
9 error npm  v2.14.12
10 error code EISDIR
11 error errno -4068
12 error syscall read
13 error eisdir EISDIR: illegal operation on a directory, read
13 error eisdir This is most likely not a problem with npm itself
13 error eisdir and is related to npm not being able to find a package.json in
13 error eisdir a package you are trying to install.
14 verbose exit [ -4068, true ]

我已经尝试过多次卸载和重新安装nodejs,甚至删除了C:\ Users \ me \ AppData \ Roaming中的npm和npm-cache文件夹.我不确定导致此问题的原因是什么.一秒钟它工作正常,现在我无法摆脱这个错误.日志中的解释没有任何意义,因为它在任何目录中都会出现此错误.我应该注意,以管理员身份运行命令提示符不会出现此错误.我将在这个星期五晚上把头发拉出来,试图修复它,任何帮助将不胜感激!

I have tried and uninstalling/reinstalling nodejs multiple times, I even deleted npm and npm-cache folders in C:\Users\me\AppData\Roaming. I'm not sure what went wrong to cause this. One second it was working fine, and now I can't get rid of this error. The explanation in the log does not make sense, as it gives this error in any directory. I should note that running a command prompt as administrator does not give this error. I'm pulling my hair out this Friday evening trying to get this fixed, any help would be greatly appreciated!

推荐答案

在更改某些npm设置时遇到了相同的问题.我用一个npm config set命令犯了一个错误,这在C:\Users\{User}\.npmrc上添加了一行引用了不存在的目录.我从.npmrc手动删除该行后,问题消失了.

I ran into the same problem while I was changing some npm settings. I did a mistake with one npm config set command and this added a line referring to a non-existing directory to C:\Users\{User}\.npmrc. After I deleted that line manually from .npmrc, the problem was gone.

这篇关于NPM卡住,给出相同的错误EISDIR:对目录的非法操作,读取时出错(本机)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 09:15