【问题标题】:sysmlink error when installing tensorflow/tfjs-node安装 tensorflow/tfjs-node 时出现 sysmlink 错误
【发布时间】:2021-05-29 18:57:03
【问题描述】:

我正在尝试安装 @tensorflow/tfjs-node@3.2.1(最新)。 我已经关注了很多关于此类问题的其他问题,但尚未找到此特定问题的答案。

我已使用请求的构建工具安装了 Visual Studio。

节点 14.15.5

尝试使用和不使用标志。

这是安装命令的输出:

$ npm install @tensorflow/tfjs-node --build-from-source
npm WARN deprecated node-pre-gyp@0.14.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future

> @tensorflow/tfjs-node@3.2.0 install C:\Users\dark_\Desktop\projects\tfjs2\node_modules\@tensorflow\tfjs-node
> node scripts/install.js

CPU-windows-3.2.0.zip
* Downloading libtensorflow

* Building TensorFlow Node.js bindings
symlink ./lib/napi-v7 failed:  null
npm WARN tfjs2@1.0.0 No description
npm WARN tfjs2@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @tensorflow/tfjs-node@3.2.0 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @tensorflow/tfjs-node@3.2.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\dark_\AppData\Roaming\npm-cache\_logs\2021-02-27T18_14_41_492Z-debug.log

【问题讨论】:

  • 我遇到了完全相同的问题,您找到解决方法了吗?
  • @FawazAhmed 不,但我也在这里发布了一个问题:github.com/tensorflow/tfjs/issues/4761 希望我能在那里得到帮助。

标签: tensorflow.js


【解决方案1】:

花了一天时间尝试通常的问题(node-gyp 重新安装为全局、Windows 构建工具(重新)安装为全局、参数设置等)后,我调试了安装脚本并在其中发现了一个错误:在symlink的东西,作者没有检查“error”变量,直接上process.exit(1)

在我拔掉头发后,我发现解决方案正在路上:

https://github.com/tensorflow/tfjs/commit/2e745c8b6efe5ffc396a86cfc50347e629091248

它已经提交到主分支(2021.02.26),所以我们可能会在 v3.3.0 或 v3.2.x 中看到它

现在的问题是,如果您只执行简单的npm install @tensorflow\tfjs-node,安装程序会将其视为错误,并删除node_modules 中的整个下载目录。您可以通过以下方式阻止整件事:

  • 正在执行npm install @tensorflow/tfjs-node --ignore-scripts
  • 然后在安装脚本中手动更正错误(检查上面链接中的提交)和
  • 正在运行npm rebuild @tensorflow/tfjs-node --build-from-source

我需要重新启动 VSCode,因为它很难获取引用。不过如果你不想乱来,暂时还是回到v2.x分支吧。

【讨论】:

    猜你喜欢
    • 2018-12-25
    • 1970-01-01
    • 1970-01-01
    • 2020-04-18
    • 2018-06-21
    • 1970-01-01
    • 2020-01-03
    • 1970-01-01
    • 2020-08-16
    相关资源
    最近更新 更多