没有规则来制作目标`node_modules/node-gyp/addon.gypi`,`Makefile'需要

Mat*_*ley 5 makefile node.js npm node-gyp node-modules

我在尝试安装我正在处理的软件包的要求时遇到错误,它到达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
Run Code Online (Sandbox Code Playgroud)

2019-06-16T10_33_53_751Z-debug.log

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

Jon*_*han 0

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

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