使用electron-drag问题,electron-rebuild 报错

新手上路,请多包涵

想使用electron-drag库实现窗口拖拽,引用后win-mouse模块会报NODE_MODULE_VERSION错误

clipboard.png
electron-rebuild重新编译win-mouse模块,会rebuild失败

λ ./node_modules/.bin/electron-rebuild
× Rebuild Failed

An unhandled error occurred inside electron-rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.15.0 | win32 | x64
gyp http GET https://atom.io/download/electron/v5.0.0/node-v5.0.0-headers.tar.gz
gyp http 200 https://atom.io/download/electron/v5.0.0/node-v5.0.0-headers.tar.gz
gyp http GET https://atom.io/download/electron/v5.0.0/SHASUMS256.txt
gyp http GET https://atom.io/download/electron/v5.0.0/win-x86/node.lib
gyp http GET https://atom.io/download/electron/v5.0.0/win-x64/node.lib
gyp http 200 https://atom.io/download/electron/v5.0.0/win-x64/node.lib
gyp http 200 https://atom.io/download/electron/v5.0.0/SHASUMS256.txt
gyp http 200 https://atom.io/download/electron/v5.0.0/win-x86/node.lib
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: read ECONNRESET
gyp ERR! stack     at TLSWrap.onStreamRead (internal/stream_base_commons.js:111:27)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Workspace\\ELECTRON\\new-skydrive_high\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=5.0.0" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source"
gyp ERR! cwd C:\Workspace\ELECTRON\new-skydrive_high\node_modules\win-mouse
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

Failed with exit code: 1

Error: gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.15.0 | win32 | x64
gyp http GET https://atom.io/download/electron/v5.0.0/node-v5.0.0-headers.tar.gz
gyp http 200 https://atom.io/download/electron/v5.0.0/node-v5.0.0-headers.tar.gz
gyp http GET https://atom.io/download/electron/v5.0.0/SHASUMS256.txt
gyp http GET https://atom.io/download/electron/v5.0.0/win-x86/node.lib
gyp http GET https://atom.io/download/electron/v5.0.0/win-x64/node.lib
gyp http 200 https://atom.io/download/electron/v5.0.0/win-x64/node.lib
gyp http 200 https://atom.io/download/electron/v5.0.0/SHASUMS256.txt
gyp http 200 https://atom.io/download/electron/v5.0.0/win-x86/node.lib
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: read ECONNRESET
gyp ERR! stack     at TLSWrap.onStreamRead (internal/stream_base_commons.js:111:27)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Workspace\\ELECTRON\\new-skydrive_high\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=5.0.0" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source"
gyp ERR! cwd C:\Workspace\ELECTRON\new-skydrive_high\node_modules\win-mouse
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

Failed with exit code: 1
    at SafeSubscriber._error (C:\Workspace\ELECTRON\new-skydrive_high\node_modules\spawn-rx\lib\src\index.js:267:84)
    at SafeSubscriber.__tryOrUnsub (C:\Workspace\ELECTRON\new-skydrive_high\node_modules\rxjs\internal\Subscriber.js:205:16)
    at SafeSubscriber.error (C:\Workspace\ELECTRON\new-skydrive_high\node_modules\rxjs\internal\Subscriber.js:156:26)
    at Subscriber._error (C:\Workspace\ELECTRON\new-skydrive_high\node_modules\rxjs\internal\Subscriber.js:92:26)
    at Subscriber.error (C:\Workspace\ELECTRON\new-skydrive_high\node_modules\rxjs\internal\Subscriber.js:72:18)
    at MapSubscriber.Subscriber._error (C:\Workspace\ELECTRON\new-skydrive_high\node_modules\rxjs\internal\Subscriber.js:92:26)
    at MapSubscriber.Subscriber.error (C:\Workspace\ELECTRON\new-skydrive_high\node_modules\rxjs\internal\Subscriber.js:72:18)
    at SafeSubscriber._next (C:\Workspace\ELECTRON\new-skydrive_high\node_modules\spawn-rx\lib\src\index.js:242:65)
    at SafeSubscriber.__tryOrUnsub (C:\Workspace\ELECTRON\new-skydrive_high\node_modules\rxjs\internal\Subscriber.js:205:16)
    at SafeSubscriber.next (C:\Workspace\ELECTRON\new-skydrive_high\node_modules\rxjs\internal\Subscriber.js:143:22)

请大家帮帮忙

阅读 7.9k
2 个回答

是不是你的Electron版本太高了,我自己打包5.0.0以上的版本暂时都无法正常打包,但是4.0.6的版本可以

我node用的8.16 electron用的2.0.0之后不会报这个版本错误,但是会报另一个错误
clipboard.png

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题