SAP / node-rfc

Asynchronous, non-blocking SAP NW RFC SDK bindings for Node.js
Apache License 2.0
254 stars 74 forks source link

cannot deploy on heroku #122

Open caitlin05 opened 4 years ago

caitlin05 commented 4 years ago

how do I set the sdk location( heroku git) on the nodeJS app file? I have set the node-rfc as a dependency { "name": "testDep", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "node app.js" }, "engines": { "node": "10.x" }, "dependencies": { "node-rfc": "^1.0.3" }, "keywords": [], "author": "", "license": "ISC" } git push heroku master is always failing

fredimartins commented 4 years ago

You need SAP NW RFC SDK as described in Readme and follow the install instructions. You need adapt the instructions for heroku. http://sap.github.io/node-rfc/install.html#sap-nw-rfc-library-installation https://support.sap.com/en/product/connectors/nwrfcsdk.html

caitlin05 commented 4 years ago

I already have the SDK, I already have it in my Heroku Git, but build always fails because of the node-rfc installation.

bsrdjan commented 4 years ago

Could you please post the error message?

caitlin05 commented 4 years ago

Please see build log below

-----> Node.js app detected

-----> Creating runtime environment

       NPM_CONFIG_LOGLEVEL=error
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       NODE_VERBOSE=false

-----> Installing binaries
       engines.node (package.json):  10.x
       engines.npm (package.json):   unspecified (use default)

       Resolving node version 10.x...
       Downloading and installing node 10.18.1...
       Using default npm version: 6.13.4

-----> Restoring cache
       - node_modules (not cached - skipping)

-----> Installing dependencies
       Installing node modules (package.json + package-lock)

       > node-rfc@1.0.3 preinstall /tmp/build_3b979f50852adc2bff3c74e45278ad15/node_modules/node-rfc
       > npm install cmake-js prebuild-install prebuild node-addon-api

       + node-addon-api@1.7.1
       + prebuild-install@5.3.3
       + prebuild@9.1.1
       + cmake-js@5.3.2
       added 1 package from 44 contributors and audited 1205 packages in 14.027s
       found 0 vulnerabilities

       > node-rfc@1.0.3 install /tmp/build_3b979f50852adc2bff3c74e45278ad15/node_modules/node-rfc
       > prebuild-install --tag-prefix -r napi || npm run prebuild

       sh: 1: prebuild-install: not found

       > node-rfc@1.0.3 prebuild /tmp/build_3b979f50852adc2bff3c74e45278ad15/node_modules/node-rfc
       > prebuild --backend cmake-js -r napi --force --strip --verbose --tag-prefix

       sh: 1: prebuild: not found
       npm ERR! code ELIFECYCLE
       npm ERR! syscall spawn
       npm ERR! file sh
       npm ERR! errno ENOENT
       npm ERR! node-rfc@1.0.3 prebuild: `prebuild --backend cmake-js -r napi --force --strip --verbose --tag-prefix`
       npm ERR! spawn ENOENT
       npm ERR! 
       npm ERR! Failed at the node-rfc@1.0.3 prebuild 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!     /tmp/npmcache.LqLZV/_logs/2020-01-28T13_40_22_061Z-debug.log
       npm ERR! code ELIFECYCLE
       npm ERR! errno 1
       npm ERR! node-rfc@1.0.3 install: `prebuild-install --tag-prefix -r napi || npm run prebuild`
       npm ERR! Exit status 1
       npm ERR! 
       npm ERR! Failed at the node-rfc@1.0.3 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!     /tmp/npmcache.LqLZV/_logs/2020-01-28T13_40_22_146Z-debug.log
-----> Build failed

       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys

       If you're stuck, please submit a ticket so we can help:
       https://help.heroku.com/

       Love,
       Heroku

 !     Push rejected, failed to compile Node.js app.
 !     Push failed
fredimartins commented 4 years ago

it seems to be a linux version, when i tried to make a docker image with alpine i received the same error, debian and ubuntu works well. In This case, the npm install prebuild-install but it can not be seen when a build starts.

caitlin05 commented 4 years ago

sorry but im not familiar with that. did you mean to say that heroku is linux-based? does this mean that it won't work on linux?

bsrdjan commented 4 years ago

prebuild requires locally installed CMake. Is CMake installed on docker/heroku?

Where the ABAP backend system should be installed, to be reached from Heroku?

Siva1963 commented 4 years ago

Hi @bsrdjan getting below error when passing NODE_ENV=production

[0m[4/4] Building fresh packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
[91merror /root/app/node_modules/node-rfc: Command failed.
Exit code: 1
Command: prebuild-install --tag-prefix -r napi || npm run prebuild
Arguments: 
Directory: /root/app/node_modules/node-rfc
Output:
/bin/sh: 1: prebuild-install: not found
npm WARN lifecycle The node binary used for scripts is /tmp/yarn--1586444958998-0.7247393224243084/node but npm is using /usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> node-rfc@1.0.6 prebuild /root/app/node_modules/node-rfc
> prebuild --backend cmake-js -r napi --force --strip --verbose --tag-prefix
sh: 1: prebuild: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! node-rfc@1.0.6 prebuild: `prebuild --backend cmake-js -r napi --force --strip --verbose --tag-prefix`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the node-rfc@1.0.6 prebuild 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!     /root/.npm/_logs/2020-04-09T15_09_28_184Z-debug.log
[0mMakefile:7: recipe for target 'bootstrap' failed
[91mmake: *** [bootstrap] Error 1
[0mThe command '/bin/sh -c make bootstrap' returned a non-zero code: 2
[Pipeline] }

Node version used - 10.19.0

This happens only in production in other env's it works fine

bsrdjan commented 4 years ago

Reproduced on Windows and found no NODE_ENV related issues for prebuild. Let see if any feedback on issue posted there.

bsrdjan commented 4 years ago

The feature request to enable SAP NWRFC SDK usage on heroku, in Connectivity context, can be created for:

Security Services category of the SAP Cloud Platform – Platform Foundation

bsrdjan commented 3 years ago

You may vote for the new request, linked here: https://github.com/SAP/node-rfc/issues/145#issuecomment-781209573