【问题标题】:NPM Install Error Woes: "npm ERR! code EINVAL"NPM 安装错误问题:“npm ERR!代码 EINVAL”
【发布时间】:2018-04-16 16:52:54
【问题描述】:

首先,这一切都可以在我的 OS X 机器上运行(和往常一样)。有些东西在 Windows 上表现不佳,我想看看是否有人遇到过这种类型的错误,因为 stackoverflow 似乎充斥着关于这个主题的未解决问题。

我在 Windows 7 上遇到了npm install 的问题,其中我使用 nvm 进行 node@8.1.2 和 npm@5.0.3 的节点版本管理窗口。这个EINVAL 样式错误似乎出现在各种问题中,例如:

getting “Error: EINVAL: invalid argument, read” for “npm install --save-dev eslint --verbose” 答案是使用 yarn 而不是 npm。另一种解决方案是尝试npm cache clean,npm 告诉我它不再适用于版本 5 以上。

npm installed dependencies crash ied `Error: EINVAL: invalid argument, readlink 仍未解决。

这里的输出看到 npm-debug 日志是一个“跳过可选依赖项”行的大球。

12208 verbose stack Error: EINVAL: invalid argument, utime 'E:\htdocs\pole-refactor\node_modules\.staging\lru-cache-01620014\package.json'
12209 verbose cwd E:\htdocs\pole-refactor
12210 verbose Windows_NT 6.1.7601
12211 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
12212 verbose node v8.1.2
12213 verbose npm  v5.0.3
12214 error path E:\htdocs\pole-refactor\node_modules\.staging\lru-cache-01620014\package.json
12215 error code EINVAL
12216 error errno -4071
12217 error syscall utime
12218 error EINVAL: invalid argument, utime 'E:\htdocs\pole-refactor\node_modules\.staging\lru-cache-01620014\package.json'
12219 verbose exit [ -4071, true ]

我已经浏览了其他各种 EINVAL 线程,但到目前为止空手而归。有没有人有任何想法我可以尝试,我们可以在这里记录?

【问题讨论】:

  • 为此添加一点。尝试使用 yarn 安装依赖项时,我收到类似的错误:info fsevents@1.1.3: The platform "win32" is incompatible with this module. info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... error An unexpected error occurred: "EINVAL: invalid argument, futime".

标签: node.js npm npm-install


【解决方案1】:

我用消息解决了这个问题:

npm ERR! EINVAL: invalid argument, utime

执行以下步骤:

npm install -g npm@latest
cd your_project_directory
rm -rf node_modules
npm install

那,基本上升级节点包,然后刷新项目的包。

【讨论】:

  • 我遇到了另一个错误 TypeError:无效的选项参数。我没有意识到 npm 在我的情况下在当前目录中放置了一个目录 /.谢谢!
猜你喜欢
  • 2021-07-27
  • 1970-01-01
  • 2023-03-02
  • 2019-05-11
  • 2019-08-20
  • 1970-01-01
  • 1970-01-01
  • 2019-05-10
  • 1970-01-01
相关资源
最近更新 更多