2017-09-28 29 views
0

安装的NodeJS包在我的老流星版本时,我能够与安装swisseph的NodeJS包:获取错误的Python版本尝试与流星

npm install swisseph 

但在当时,我不得不使用

var swisseph = Meteor.npmRequire('swisseph'); 

这是从

https://github.com/meteorhacks/npm 

现在我读了Meteorhacks不再ñ eeded。我的问题现在是我的应用程序取决于使用swisseph NODEjs包但我现在无法安装它。

我收到以下错误:

npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue 
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue 

[email protected] install /Users/bliss/Documents/Coder/ReactMeteor/react-vedic/node_modules/swisseph 
node-gyp rebuild 

gyp ERR! configure error 
gyp ERR! Error: Python executable "/Users/bliss/anaconda/bin/python" is v3.6.1, which is not supported by gyp. 
gyp ERR! You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0. 
gyp ERR!  at PythonFinder.failPythonVersion (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:492:19) 
gyp ERR!  at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:474:14) 
gyp ERR!  at ChildProcess.exithandler (child_process.js:262:7) 
gyp ERR!  at emitTwo (events.js:125:13) 
gyp ERR!  at ChildProcess.emit (events.js:213:7) 
gyp ERR!  at maybeClose (internal/child_process.js:897:16) 
gyp ERR!  at Socket.stream.socket.on (internal/child_process.js:340:11) gyp ERR!  at emitOne (events.js:115:13) 
gyp ERR!  at Socket.emit (events.js:210:7) 
gyp ERR!  at Pipe._handle.close [as _onclose] (net.js:548:12) 
gyp ERR! System Darwin 16.6.0 
gyp ERR! command "/usr/local/Cellar/node/8.1.2/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
gyp ERR! cwd /Users/bliss/Documents/Coder/ReactMeteor/react-vedic/node_modules/swisseph 
gyp ERR! node -v v8.1.2 
gyp ERR! node-gyp -v v3.6.2 
gyp ERR! not ok 
npm ERR! code ELIFECYCLE 
npm ERR! errno 1 
npm ERR! [email protected] install: `node-gyp rebuild` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] install script. 
npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 

如何使用这个节点程序包,即使它仅仅是在服务器端?

+0

从很明显,你必须把它指向Python'的'正确的版本错误。 – Styx

回答

-1

我的电脑上的python版本高于正确安装所需的python版本。我能够通过明确指定由npm install使用蟒蛇的版本来解决这个:

npm --python=python2.7 install swisseph 
+0

这应该是对问题的编辑,而不是“答案”。 – Styx