我尝试使用node express服务器设置prerender.io但在设置系统时出现问题。我使用Windows 10并安装了nodejs来使用npm package.I安装了prerenderjs,node server和phantomjs来启动与node express服务器的SEO。 当我运行节点server.js'它为丢失的模块提供了以下错误' weak'这是我认为运行prerender.io的一些依赖。
npm install weak
然后我试图安装“弱”'通过npm喜欢
npm WARN package.json prerender@3.22.1 No license field.
-
> weak@1.0.0 install C:\prerender-master\node_modules\weak
> node-gyp rebuild
C:\prerender-master\node_modules\weak>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp- bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Python executable "python" is v3.5.0, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack at failPythonVersion (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:121:14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:110:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:194:7)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at maybeClose (internal/child_process.js:817:16)
gyp ERR! stack at Socket.<anonymous> (internal/child_process.js:319:11)
gyp ERR! stack at emitOne (events.js:77:13)
gyp ERR! stack at Socket.emit (events.js:169:7)
gyp ERR! stack at Pipe._onclose (net.js:469:12)
gyp ERR! System Windows_NT 10.0.10240
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:\prerender-master\node_modules\weak
gyp ERR! node -v v4.1.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "weak"
npm ERR! node v4.1.0
npm ERR! npm v2.14.3
npm ERR! code ELIFECYCLE
npm ERR! weak@1.0.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the weak@1.0.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the weak 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 weak
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\prerender-master\npm-debug.log
但是它给出了以下错误
activity.getSupportFragmentManager()
我也试过npm install node-gyp,然后再次尝试安装“弱”&#39;但同样的错误。我搜索了错误但无法理解解决方案。我会非常感谢任何帮助。感谢
答案 0 :(得分:0)
gyp ERR! stack错误:Python可执行文件&#34; python&#34;是v3.5.0,是 gyp不支持。 gyp ERR! stack你可以传递--python 切换到指向Python&gt; = v2.5.0&amp; &LT; 3.0.0。
看起来你只需要提供不同版本的Python