gpt4 book ai didi

javascript - 部署到Heroku node-gyp无法安装base64@2.1.0,node-gyp重建失败

转载 作者:行者123 更新时间:2023-12-03 11:33:18 26 4
gpt4 key购买 nike

我正在尝试在heroku中安装nodejs应用程序,但无法部署,因为base64库的node-gyp重建。任何解决此部署问题的想法。

本地工作正常,问题仅在于部署到heroku中。有什么想法可以解决吗?

Gizras-iMac:negawatt-iec-scraper gizra$ git push heroku master
Fetching repository, done.
Counting objects: 76, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (49/49), done.
Writing objects: 100% (49/49), 11.00 KiB | 0 bytes/s, done.
Total 49 (delta 37), reused 0 (delta 0)

-----> Fetching custom git buildpack... done
-----> Node.js app detected

PRO TIP: Specify a node version in package.json
See https://devcenter.heroku.com/articles/nodejs-support

-----> Defaulting to latest stable node: 0.10.33
-----> Downloading and installing node
-----> Restoring node_modules directory from cache
-----> Pruning cached dependencies not specified in package.json
-----> Node version changed since last build; rebuilding dependencies

> base64@2.1.0 install /tmp/build_fc23248efe5a35c5b79d9762e3733365/node_modules/base64
> node-gyp rebuild

make: Entering directory `/tmp/build_fc23248efe5a35c5b79d9762e3733365/node_modules/base64/build'
CXX(target) Release/obj.target/base64/base64.o
SOLINK_MODULE(target) Release/obj.target/base64.node
SOLINK_MODULE(target) Release/obj.target/base64.node: Finished
COPY Release/base64.node
ACTION binding_gyp_after_build_target_symlink /tmp/build_fc23248efe5a35c5b79d9762e3733365/node_modules/base64/base64.node
ln: creating symbolic link `/tmp/build_fc23248efe5a35c5b79d9762e3733365/node_modules/base64/base64.node': File exists
make: *** [/tmp/build_fc23248efe5a35c5b79d9762e3733365/node_modules/base64/base64.node] Error 1
make: Leaving directory `/tmp/build_fc23248efe5a35c5b79d9762e3733365/node_modules/base64/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/tmp/build_fc23248efe5a35c5b79d9762e3733365/vendor/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Linux 3.8.11-ec2
gyp ERR! command "node" "/tmp/build_fc23248efe5a35c5b79d9762e3733365/vendor/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /tmp/build_fc23248efe5a35c5b79d9762e3733365/node_modules/base64
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok

npm ERR! base64@2.1.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the base64@2.1.0 install script.
npm ERR! This is most likely a problem with the base64 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls base64
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.8.11-ec2
npm ERR! command "/tmp/build_fc23248efe5a35c5b79d9762e3733365/vendor/node/bin/node" "/tmp/build_fc23248efe5a35c5b79d9762e3733365/vendor/node/bin/npm" "rebuild"
npm ERR! cwd /tmp/build_fc23248efe5a35c5b79d9762e3733365
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /tmp/build_fc23248efe5a35c5b79d9762e3733365/npm-debug.log
npm ERR! not ok code 0

最佳答案

老问题,但我遇到了这个问题并通过几种途径解决了它:

  1. Failed at the base64@2.1.0 install script

此处的 base64@2.1.0 可能与运行项目的 Node 版本不兼容。尝试安装早期版本。

  • 删除计算机上的 ~/.node-gyp 文件夹(使用空格键并搜索 ~/.node-gyp),然后尝试在全局范围内重新安装 node-gyp。
  • 关于javascript - 部署到Heroku node-gyp无法安装base64@2.1.0,node-gyp重建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26648090/

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