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,然後再次嘗試安裝'弱'但同樣的錯誤。我查找了錯誤,但無法理解解決方案。我會非常感謝任何幫助。由於