简体   繁体   中英

Deploying into Heroku node-gyp can not install base64@2.1.0, node-gyp rebuild failed

I'm trying to install a nodejs application in heroku but can not be deployed, because node-gyp rebuild of the base64 library. Any idea to solve this deploy issue.

Works ok locally, the issue is only deploying into heroku. Any ideas to solve it?

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

Old question but I ran into this and solved it via a few routes:

  1. Failed at the base64@2.1.0 install script

Here the base64@2.1.0 might not be compatible with your version of node running your project. Try to install an earlier version.

  1. Delete the ~/.node-gyp folder on your computer (command spacebar and search for ~/.node-gyp) and try reinstalling node-gyp globally.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM