YaoZeyuan / zhihuhelp

基于node&typescript重写知乎助手
https://www.yaozeyuan.online/zhihuhelp/
MIT License
854 stars 169 forks source link

依赖包安装失败 #2

Closed jazzson closed 5 years ago

jazzson commented 5 years ago

命令行 npm install --registry=https://registry.npm.taobao.org 调用失败,操作系统 windows server 2008R2 (X64), node 安装版本为 node-v10.15.1-x64。姚工能否帮忙看看?

安装过程提示 C:\Users\Administrator\Downloads\zhihuhelp_with_node-master\zhihuhelp_with_node- master>npm install --registry=https://registry.npm.taobao.org

zhihuhelp@1.0.0 postinstall C:\Users\Administrator\Downloads\zhihuhelp_with_no de-master\zhihuhelp_with_node-master install-app-deps

• please use as subcommand: electron-builder install-app-deps • electron-builder version=20.38.5 • loaded configuration file=package.json ("build" field) • rebuilding native production dependencies platform=win32 arch=x64 Error: C:\Program Files\nodejs\node.exe exited with code 1 Output:

sqlite3@4.0.6 install C:\Users\Administrator\Downloads\zhihuhelp_with_node-mas ter\zhihuhelp_with_node-master\node_modules\sqlite3 node-pre-gyp install --fallback-to-build

Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node _modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Administrator\Downloads\zhihuhelp_withnode-master\zhihuhelp with_node-master\node_modules\sqlite3\lib\binding\electron-v4.0-win32-x64\node_s qlite3.node --module_name=node_sqlite3 --module_path=C:\Users\Administrator\Down loads\zhihuhelp_with_node-master\zhihuhelp_with_node-master\node_modules\sqlite3 \lib\binding\electron-v4.0-win32-x64 --napi_version=3 --node_abi_napi=napi --nap i_build_version=0 --node_napi_label=electron-v4.0' (1)

Error output: node-pre-gyp WARN Using request for node-pre-gyp https download gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT HON env variable. gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files\nodejs\node_mo dules\npm\node_modules\node-gyp\lib\configure.js:484:19) gyp ERR! stack at PythonFinder. (C:\Program Files\nodejs\node_mod ules\npm\node_modules\node-gyp\lib\configure.js:509:16) gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\grac eful-fs\polyfills.js:284:29 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:154:21) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodej s\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--f allback-to-build" "--module=C:\Users\Administrator\Downloads\zhihuhelpwith node-master\zhihuhelp_with_node-master\node_modules\sqlite3\lib\binding\el ectron-v4.0-win32-x64\node_sqlite3.node" "--module_name=node_sqlite3" "--module _path=C:\Users\Administrator\Downloads\zhihuhelp_with_node-master\zhihuhelp _with_node-master\node_modules\sqlite3\lib\binding\electron-v4.0-win32-x64" "--napi_version=3" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi _label=electron-v4.0" gyp ERR! cwd C:\Users\Administrator\Downloads\zhihuhelp_with_node-master\zhihuhe lp_with_node-master\node_modules\sqlite3 gyp ERR! node -v v10.15.1 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.e xe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.j s configure --fallback-to-build --module=C:\Users\Administrator\Downloads\zhihuh elp_with_node-master\zhihuhelp_with_node-master\node_modules\sqlite3\lib\binding \electron-v4.0-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_p ath=C:\Users\Administrator\Downloads\zhihuhelp_with_node-master\zhihuhelp_with_n ode-master\node_modules\sqlite3\lib\binding\electron-v4.0-win32-x64 --napi_versi on=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=electron-v4.0 ' (1) node-pre-gyp ERR! stack at ChildProcess. (C:\Users\Administrator\ Downloads\zhihuhelp_with_node-master\zhihuhelp_with_node-master\node_modules\nod e-pre-gyp\lib\util\compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:189:13) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:970:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/chi ld_process.js:259:5) node-pre-gyp ERR! System Windows_NT 6.1.7601 node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Admi nistrator\Downloads\zhihuhelp_with_node-master\zhihuhelp_with_node-master\no de_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd C:\Users\Administrator\Downloads\zhihuhelp_with_node-maste r\zhihuhelp_with_node-master\node_modules\sqlite3 node-pre-gyp ERR! node -v v10.15.1 node-pre-gyp ERR! node-pre-gyp -v v0.11.0 node-pre-gyp ERR! not ok npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! sqlite3@4.0.6 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the sqlite3@4.0.6 install script. npm ERR! This is probably not a problem with npm. There is likely additional log ging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2019-02-16T0 9_17_31_619Z-debug.log

at ChildProcess.childProcess.once.code (C:\Users\Administrator\Downloads\zhi

huhelp_with_node-master\zhihuhelp_with_node-master\node_modules\builder-util\src \util.ts:244:14) at Object.onceWrapper (events.js:277:13) at ChildProcess.emit (events.js:189:13) at maybeClose (internal/child_process.js:970:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) From previous event: at _rebuild (C:\Users\Administrator\Downloads\zhihuhelp_with_node-master\zhi huhelp_with_node-master\node_modules\app-builder-lib\src\util\yarn.ts:179:5) at rebuild (C:\Users\Administrator\Downloads\zhihuhelp_with_node-master\zhih uhelp_with_node-master\node_modules\app-builder-lib\out\util\yarn.js:163:19) at C:\Users\Administrator\Downloads\zhihuhelp_with_node-master\zhihuhelp_wit h_node-master\node_modules\app-builder-lib\src\util\yarn.ts:20:11 From previous event: at _installOrRebuild (C:\Users\Administrator\Downloads\zhihuhelp_with_node-m aster\zhihuhelp_with_node-master\node_modules\app-builder-lib\out\util\yarn.js:7 1:28) at installOrRebuild (C:\Users\Administrator\Downloads\zhihuhelp_with_node-ma ster\zhihuhelp_with_node-master\node_modules\app-builder-lib\out\util\yarn.js:55 :28) at C:\Users\Administrator\Downloads\zhihuhelp_with_node-master\zhihuhelp_wit h_node-master\node_modules\electron-builder\src\cli\install-app-deps.ts:56:9 at Generator.next () at runCallback (timers.js:705:18) at tryOnImmediate (timers.js:676:5) at processImmediate (timers.js:658:5) From previous event: at _installAppDeps (C:\Users\Administrator\Downloads\zhihuhelp_with_node-mas ter\zhihuhelp_with_node-master\node_modules\electron-builder\out\cli\install-app -deps.js:176:26) at installAppDeps (C:\Users\Administrator\Downloads\zhihuhelp_with_node-mast er\zhihuhelp_with_node-master\node_modules\electron-builder\out\cli\install-app- deps.js:144:26) at main (C:\Users\Administrator\Downloads\zhihuhelp_with_node-master\zhihuhe lp_with_node-master\node_modules\electron-builder\src\cli\install-app-deps.ts:65 :10) at Object. (C:\Users\Administrator\Downloads\zhihuhelp_with_node- master\zhihuhelp_with_node-master\node_modules\electron-builder\src\cli\install- app-deps.ts:70:3) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Function.Module.runMain (internal/modules/cjs/loader.js:742:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! zhihuhelp@1.0.0 postinstall: install-app-deps npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the zhihuhelp@1.0.0 postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional log ging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2019-02-16T0 9_17_31_700Z-debug.log

YaoZeyuan commented 5 years ago

这里是因为package.json写错了, 应该是"postinstall": "electron-builder install-app-deps",, 我当时写成了"postinstall": "install-app-deps",

已修复, 感谢反馈~