mivion / swisseph

Swiss Ephemeris binding for node.js
GNU General Public License v2.0
205 stars 72 forks source link

Can't install #50

Closed inspiraller closed 6 years ago

inspiraller commented 6 years ago

I followed the instructions npm install and I get an error

node: 8.94 windows 7 visual studion 2017 community edition I have .net sdk2.


 swisseph@0.5.8 install c:\baps\node_all\swissephem\swisseph
> node-gyp rebuild

c:\baps\node_all\swissephem\swisseph>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it
is installed elsewhere.  [c:\baps\node_all\swissephem\swisseph\build\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd c:\baps\node_all\swissephem\swisseph
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! swisseph@0.5.8 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the swisseph@0.5.8 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!     C:\Users\steve\AppData\Roaming\npm-cache\_logs\2018-02-19T16_15_54_699Z-debug.log
inspiraller commented 6 years ago

also tried with node v4.8.7 and same problem

keel commented 6 years ago

This is a node-gyp error, any module need compile with gyp will be failed to install, you can check https://github.com/nodejs/node-gyp#on-windows and find some way to resolve it.

  1. make sure nodejs with npm install OK, check the install log, maybe you need reinstall;
  2. make sure python, C++ build tool... install well.
  3. run npm config set msvs_version 2015 or your version
  4. install Visual Studio Express version (someone told me it's a killer, I'm not sure)
  5. try it on mac or linux or vm...(sorry, I don't use windows)

Good luck!

strigefleur commented 6 years ago

As per this SO example, you have to meet swisseph requirements in node-gyp part, in shorts:

 $ npm install --global --production windows-build-tools
 $ npm install --global node-gyp

now it should be enough to swisseph to be built.

blissGitHub commented 6 years ago

Hi, I'm trying to install swisseph via

meteor npm install --save swisseph

and I'm getting this error:

npm WARN deprecated minimatch@1.0.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

swisseph@0.5.8 install /Users/bliss/Documents/Coder/ReactMeteor/new/node_modules/swisseph node-gyp rebuild

gyp ERR! configure error gyp ERR! stack Error: Command failed: /Users/bliss/anaconda/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack File "", line 1 gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack ^ gyp ERR! stack SyntaxError: invalid syntax gyp ERR! stack gyp ERR! stack at ChildProcess.exithandler (child_process.js:275:12) gyp ERR! stack at emitTwo (events.js:126:13) gyp ERR! stack at ChildProcess.emit (events.js:214:7) gyp ERR! stack at maybeClose (internal/child_process.js:925:16) gyp ERR! stack at Socket.stream.socket.on (internal/child_process.js:346:11) gyp ERR! stack at emitOne (events.js:116:13) gyp ERR! stack at Socket.emit (events.js:211:7) gyp ERR! stack at Pipe._handle.close [as _onclose] (net.js:557:12) gyp ERR! System Darwin 16.7.0 gyp ERR! command "/Users/bliss/.meteor/packages/meteor-tool/.1.8.0.13gd4dz.15ig++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/node" "/Users/bliss/.meteor/packages/meteor-tool/.1.8.0.13gd4dz.15ig++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/bliss/Documents/Coder/ReactMeteor/new/node_modules/swisseph gyp ERR! node -v v8.11.4 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! swisseph@0.5.8 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the swisseph@0.5.8 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! /Users/bliss/.npm/_logs/2018-11-03T15_33_53_276Z-debug.log

How to solve this?