SAP / node-rfc

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

build failed for Node.js 7 #27

Closed jiabiao closed 7 years ago

jiabiao commented 7 years ago

There is no precompiled binding rfc.node for node V51, so npm tried to build it from source. But it seems can not found the source files: rfc.cc ,error.cc, rfcio.cc, Client.cc. I had set the environment SAPNWRFC_HOME = D:\Program Files\nwrfcsdk

node-pre-gyp ERR! Tried to download(404): https://github.com/sap/node-rfc/releases/download/0.1.11/rfc-v0.1.11-node-v51-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for node-rfc@0.1.11 and node@7.10.0 (node-v51 ABI) (falling back to source compile with node-gyp)

D:\Code\demo\Node\sap\node_modules\node-rfc>if not defined npm_config_node_gyp (node "C:\Users\bj95\AppData\Roaming\nvm\v7.10.0\node_modules\npm\bin\
node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" clean )  else (node "" clean )

D:\Code\demo\Node\sap\node_modules\node-rfc>if not defined npm_config_node_gyp (node "C:\Users\bj95\AppData\Roaming\nvm\v7.10.0\node_modules\npm\bin\
node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure --fallback-to-build --module=D:\Code\demo\Node\sap\node_modules\node-rfc\build\r
fc\rfc.node --module_name=rfc --module_path=D:\Code\demo\Node\sap\node_modules\node-rfc\build\rfc --python=C:\Python27amd64\python.exe --msvs_version
=2015 )  else (node "" configure --fallback-to-build --module=D:\Code\demo\Node\sap\node_modules\node-rfc\build\rfc\rfc.node --module_name=rfc --modu
le_path=D:\Code\demo\Node\sap\node_modules\node-rfc\build\rfc --python=C:\Python27amd64\python.exe --msvs_version=2015 )

D:\Code\demo\Node\sap\node_modules\node-rfc>if not defined npm_config_node_gyp (node "C:\Users\bj95\AppData\Roaming\nvm\v7.10.0\node_modules\npm\bin\
node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" build --fallback-to-build --module=D:\Code\demo\Node\sap\node_modules\node-rfc\build\rfc\r
fc.node --module_name=rfc --module_path=D:\Code\demo\Node\sap\node_modules\node-rfc\build\rfc )  else (node "" build --fallback-to-build --module=D:\
Code\demo\Node\sap\node_modules\node-rfc\build\rfc\rfc.node --module_name=rfc --module_path=D:\Code\demo\Node\sap\node_modules\node-rfc\build\rfc )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  rfc.cc
  error.cc
  rfcio.cc
  Client.cc
d:\code\demo\node\sap\node_modules\node-rfc\src\rfcio.h(21): fatal error C1083: Cannot open include file: 'sapnwrfc.h': No such file or directory (c
ompiling source file ..\src\Client.cc) [D:\Code\demo\Node\sap\node_modules\node-rfc\build\rfc.vcxproj]
d:\code\demo\node\sap\node_modules\node-rfc\src\rfcio.h(21): fatal error C1083: Cannot open include file: 'sapnwrfc.h': No such file or directory (c
ompiling source file ..\src\rfcio.cc) [D:\Code\demo\Node\sap\node_modules\node-rfc\build\rfc.vcxproj]
  win_delay_load_hook.cc
d:\code\demo\node\sap\node_modules\node-rfc\src\Client.h(23): fatal error C1083: Cannot open include file: 'sapnwrfc.h': No such file or directory (
compiling source file ..\src\rfc.cc) [D:\Code\demo\Node\sap\node_modules\node-rfc\build\rfc.vcxproj]
d:\code\demo\node\sap\node_modules\node-rfc\src\error.h(20): fatal error C1083: Cannot open include file: 'sapnwrfc.h': No such file or directory (c
ompiling source file ..\src\error.cc) [D:\Code\demo\Node\sap\node_modules\node-rfc\build\rfc.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\bj95\AppData\Roaming\nvm\v7.10.0\node_modules\npm\node_modules\node-gyp\lib\build.js:276: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 Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\bj95\\AppData\\Roaming\\nvm\\v7.10.0\\node_modules\\npm\\node_modules\\node-gyp\\b
in\\node-gyp.js" "build" "--fallback-to-build" "--module=D:\\Code\\demo\\Node\\sap\\node_modules\\node-rfc\\build\\rfc\\rfc.node" "--module_name=rfc"
 "--module_path=D:\\Code\\demo\\Node\\sap\\node_modules\\node-rfc\\build\\rfc"
gyp ERR! cwd D:\Code\demo\Node\sap\node_modules\node-rfc
gyp ERR! node -v v7.10.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd build --fallback-to-build --module=D:\Code\demo\Node\sap\node_modules\node-rfc\build\r
fc\rfc.node --module_name=rfc --module_path=D:\Code\demo\Node\sap\node_modules\node-rfc\build\rfc' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (D:\Code\demo\Node\sap\node_modules\node-rfc\node_modules\node-pre-gyp\lib\util\compile.js:83
:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:194:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:899:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Windows_NT 10.0.10586
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\Code\\demo\\Node\\sap\\node_modules\\node-rfc\\node_modules\\node-pre-gyp\\bin\\
node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd D:\Code\demo\Node\sap\node_modules\node-rfc
node-pre-gyp ERR! node -v v7.10.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.32
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd build --fallback-to-build --module=D:\Code\demo\Node\sap\node_modules\node-rfc\build\rfc\rfc.node --module_name=rfc -
-module_path=D:\Code\demo\Node\sap\node_modules\node-rfc\build\rfc' (1)
npm WARN sap@1.0.0 No description
npm WARN sap@1.0.0 No repository field.
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-rfc"
npm ERR! node v7.10.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! node-rfc@0.1.11 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-rfc@0.1.11 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-rfc package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-rfc
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-rfc
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\bj95\AppData\Roaming\npm-cache\_logs\2017-05-27T07_00_19_163Z-debug.log
bsrdjan commented 7 years ago

The SAPNWRFC_HOME points to SAP NWRFC SDK binaries and does not affect finding node-rfc source files. The source files should be found when building from the node-rfc project root folder.

Steps to build from source are:

git clone https://github.com/sap/node-rfc
cd node-rfc
npm install
node-pre-gyp configure
node-pre-gyp build

When you follow these steps, could you please post the error log of the failing one?

jiabiao commented 7 years ago

thanks @bsrdjan build successfully with these steps.