简体   繁体   English

Bower安装:错误:EISDIR:对目录的非法操作,读取

[英]Bower install: Error: EISDIR: illegal operation on a directory, read

I had to upgrade node.js to v4+ (now on 4.1.0) and I am having issues now with Bower (1.5.2). 我不得不将node.js升级到v4 +(现在是4.1.0),现在我遇到了Bower(1.5.2)的问题。 I am not 100% sure that the issue started immediately after the upgrade of node.js though. 我不是100%确定在node.js升级后立即启动问题。 On all of my angular/ionic projects I get "Error: EISDIR: illegal operation on a directory, read" when issuing a "bower install". 在我的所有角度/离子项目中,我发出“错误:EISDIR:在目录上非法操作,在发出”bower install“时读取”。 This is the stacktrace: 这是堆栈跟踪:

Error: EISDIR: illegal operation on a directory, read
    at Error (native)
    at Object.fs.readSync (fs.js:603:19)
    at Object.fs.readSync (C:\Users\mvrm\AppData\Roaming\npm\node_modules\bower\node_modules\bower-config\node_modules\graceful-fs\polyfills.js:218:23)
    at Object.fs.readFileSync (fs.js:438:24)
    at C:\Users\mvrm\AppData\Roaming\npm\node_modules\bower\node_modules\bower-config\lib\util\rc.js:75:27
    at Array.forEach (native)
    at json (C:\Users\mvrm\AppData\Roaming\npm\node_modules\bower\node_modules\bower-config\lib\util\rc.js:74:14)
    at rc (C:\Users\mvrm\AppData\Roaming\npm\node_modules\bower\node_modules\bower-config\lib\util\rc.js:31:9)
    at Config.load (C:\Users\mvrm\AppData\Roaming\npm\node_modules\bower\node_modules\bower-config\lib\Config.js:14:20)
    at Function.Config.read (C:\Users\mvrm\AppData\Roaming\npm\node_modules\bower\node_modules\bower-config\lib\Config.js:49:19)

On another computer, with an older version of bower (1.3.2), there is no graceful-fs and there is no issue. 在另一台计算机上,使用较旧版本的bower(1.3.2),没有graceful-fs,也没有问题。

I found a number of posts regarding this issue but the solutions do not work for me. 我找到了一些关于这个问题的帖子,但解决方案对我不起作用。

As I understand the posts well, the issue seems to be that the code is trying to read a directory as a file. 正如我对这些帖子的理解,问题似乎是代码试图将目录作为文件读取。

Is there a way to find out which directory is being accessed as a file? 有没有办法找出哪个目录作为文件被访问? (like printing to console in polyfills.js ?) That may lead me to the cause of this issue. (比如在polyfills.js中打印到控制台?)这可能会导致我找到这个问题的原因。

Thanks a lot! 非常感谢!

After debugging the bower js code I found the solution. 调试bower js代码后,我找到了解决方案。 I do not know why, but I had a ".bowerrc" folder in my root folder ("C:\\.bowerrc"). 我不知道为什么,但我的根文件夹中有一个“.bowerrc”文件夹(“C:\\ .bowerrc”)。 The folder was empty. 该文件夹为空。 Removing the folder solved the issue! 删除文件夹解决了问题!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 fs 错误:EISDIR:对目录的非法操作,读取 - fs Error: EISDIR: illegal operation on a directory, read 纱线“错误:EISDIR:对目录的非法操作,读取” - yarn "Error: EISDIR: illegal operation on a directory, read" EISDIR - EISDIR:对目录的非法操作,读取 - EISDIR - EISDIR: illegal operation on a directory, read Discord.js 错误:EISDIR:对目录的非法操作,请阅读 - Discord.js Error: EISDIR: illegal operation on a directory, read npm 命令 - 错误:EISDIR:对目录的非法操作,请阅读 - npm command - Error: EISDIR: illegal operation on a directory, read npm无法安装本地软件包:EISDIR:对目录进行非法操作,请阅读 - npm can't install local package: EISDIR: illegal operation on a directory, read `npm install`不起作用。 未处理的拒绝错误:EISDIR:目录上的非法操作 - `npm install` not working. Unhandled rejection Error: EISDIR: illegal operation on a directory NPM 坚持给出相同的错误 EISDIR:目录上的非法操作,错误读取(本机) - NPM stuck giving the same error EISDIR: Illegal operation on a directory, read at error (native) 节点:使用 fs.readFile 获取错误:EISDIR:对目录进行非法操作,读取 - Node: Using fs.readFile getting Error: EISDIR: illegal operation on a directory, read EISDIR:对目录进行非法操作,读取+ Nodemailer映像附件 - EISDIR: illegal operation on a directory, read + Nodemailer image attachment
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM