2015-10-20 161 views
2

我试图设置与节点快递服务器prerender.io,但在我的系统上设置问题。我使用的是Windows 10并安装了nodejs来使用npm包。我安装了prerenderjs,节点服务器和phantomjs以使用节点快递服务器启动SEO。 当我运行'node server.js'时,它给出了以下错误,因为缺少模块“弱”,这是我认为运行prerender.io的一些依赖项。无法通过npm安装安装'弱'模块

2015-10-20T07:50:10.331Z worker 32 died, restarting! 
2015-10-20T07:50:10.768Z starting phantom on port [12334] 
2015-10-20T07:50:10.783Z starting phantom on port [12333] 
2015-10-20T07:50:10.807Z starting phantom on port [12335] 
2015-10-20T07:50:10.866Z Server running on port 3000 
2015-10-20T07:50:10.866Z Server running on port 3000 
2015-10-20T07:50:10.866Z Server running on port 3000 
2015-10-20T07:50:11.018Z starting phantom on port [12336] 
2015-10-20T07:50:11.043Z Server running on port 3000 
module.js:338 
throw err; 
^ 

Error: Cannot find module 'weak' 
at Function.Module._resolveFilename (module.js:336:15) 
at Function.Module._load (module.js:286:25) 
at Module.require (module.js:365:17) 
at require (module.js:384:17) 
at new D (C:\prerender-master\node_modules\phantom\node_modules\dnode\index.js:28:20) 
at module.exports (C:\prerender-master\node_modules\phantom\node_modules\dnode\index.js:8:12) 
at C:\prerender-master\node_modules\phantom\phantom.js:159:13 
at Server.handler (C:\prerender-master\node_modules\phantom\node_modules\shoe\index.js:22:9) 
at emitOne (events.js:77:13) 
at Server.emit (events.js:169:7) 
2015-10-20T07:50:12.209Z worker 34 died, restarting! 

然后我试图通过NPM安装“弱”像

npm install weak 

但其捐赠以下错误

npm WARN package.json [email protected] No license field. 
- 
> [email protected] 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! [email protected] install: `node-gyp rebuild` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] 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 

我也试过NPM安装节点GYP,然后再次尝试安装'弱'但同样的错误。我查找了错误,但无法理解解决方案。我会非常感谢任何帮助。由于

回答

0

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.

看起来像你只需要提供不同的Python版本