【问题标题】:No rule to make target `node_modules/node-gyp/addon.gypi`, needed by `Makefile'没有规则来制作“Makefile”需要的目标“node_modules/node-gyp/addon.gypi”
【发布时间】:2019-10-30 06:26:14
【问题描述】:

我在尝试安装我正在处理的软件包的要求时遇到错误,它到达 integer@2.1.0,然后由于 node-gyp 的错误而失败。

  • 节点版本:10.10.0 / 6.4.1
  • 平台:Darwin Matts-MBP-3.local 19.0.0 Darwin Kernel Version 19.0.0:2019 年 5 月 24 日星期五 17:36:10 PDT;根:xnu-6041.0.0.111.5~1/RELEASE_X86_64 x86_64
  • 编译器Apple clang version 11.0.0 (clang-1100.0.20.17) Target: x86_64-apple-darwin19.0.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin
> integer@2.1.0 install /Users/mattcowley/WebstormProjects/MagicCap/node_modules/integer
> node-gyp rebuild

make: *** No rule to make target `../../../../../../../usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', needed by `Makefile'.  Stop.
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Darwin 19.0.0
gyp ERR! command "/usr/local/Cellar/node/10.10.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/mattcowley/WebstormProjects/MagicCap/node_modules/integer
gyp ERR! node -v v10.10.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! integer@2.1.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the integer@2.1.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!     /Users/mattcowley/.npm/_logs/2019-06-16T10_33_53_751Z-debug.log

2019-06-16T10_33_53_751Z-debug.log

任何有关如何解决此问题的帮助将不胜感激! 我也已经联系并提出了 node-gyp 的问题,但认为在这里发布可能会更快地得到答案:)

【问题讨论】:

  • 我也遇到过这个问题。需要注意的是,这是在尚未向公众发布的不稳定测试版 macOS Catalina 上。这个问题可能是 Catalina 及其命令行构建工具链的问题,而不是 Node/node-gyp 的问题。

标签: node.js npm makefile node-modules node-gyp


【解决方案1】:

尝试将此添加到您的 binding.gyp:

  'include_dirs': ["<!@(node -p \"require('node-addon-api').include\")"],

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多