【发布时间】:2016-04-29 18:45:02
【问题描述】:
无论我在哪个目录中,以及我在 cmd.exe 中的“npm”之后键入什么,我都会遇到此错误。这是 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 npm@2.14.12
3 info using node@v4.2.6
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 文件夹。我不确定是什么问题导致了这种情况。一秒钟它工作正常,现在我无法摆脱这个错误。日志中的解释没有意义,因为它在任何目录中都会出现此错误。我应该注意,以管理员身份运行命令提示符不会出现此错误。我在这个星期五晚上把头发拉出来试图解决这个问题,任何帮助将不胜感激!
【问题讨论】:
-
我发现这个错误在人们更新 npm 时很常见,我想知道这个错误是在你更新 npm 时开始的,还是你根本没有更新?
-
这是一台新电脑,所以我最近几天安装了node。我刚刚在管理员模式下进行了更新,但运气不佳
-
我在这上面花了 3 个小时,终于弄明白了——原来我不小心跑了“mkdir .gitignore”
标签: node.js windows cmd npm file-permissions