gpt4 book ai didi

node.js - npm 安装失败,因为 node-gyp 失败。怎么修?

转载 作者:太空宇宙 更新时间:2023-11-03 22:26:18 28 4
gpt4 key购买 nike

我最近尝试为我们的项目进行全新安装。但现在 npm install 在 Ubuntu 17.04 上失败。我已经更改了我正在使用的node、npm、node-gyp和python的版本,但没有成功。

这是由于 node-gyp 的更改还是其他原因造成的?运行:

 node-gyp rebuild

给我:

    gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@7.10.1 | linux | x64
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/home/joel/workspace/Tracker3/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/local/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/joel/.node-gyp/7.10.1/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/joel/.node-gyp/7.10.1',
gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/home/joel/.node-gyp/7.10.1/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/home/joel/workspace/Tracker3',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/joel/workspace/Tracker3/build'
make: *** No rule to make target 'Release/obj.target/binding/src/binding.o', needed by 'Release/obj.target/binding.node'. Stop.
make: Leaving directory '/home/joel/workspace/Tracker3/build'
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/node-gyp/lib/build.js:258:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:194:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 4.11.3-041103-generic
gyp ERR! command "/home/joel/.nvm/versions/node/v7.10.1/bin/node" "/usr/local/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/joel/workspace/Tracker3
gyp ERR! node -v v7.10.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

有人知道是什么原因造成的吗?以及如何调试和修复?

最佳答案

在 ubuntu 上运行此命令 sudo apt-get install build-essential 并重试。

另请参阅here正如此处推荐的那样。

您可以看到here 有关如何重新启动的更多信息。

关于node.js - npm 安装失败,因为 node-gyp 失败。怎么修?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45829368/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com