簡體   English   中英

電子生成器無法正確安裝

[英]Electron builder wont properly install

我正在嘗試建立我的測試項目

 { "name": "////////", "version": "1.0.21", "description": "///////", "main": "index.js", "scripts": { "start": "./node_modules/.bin/electron .", "build": "build --win", "test": "echo \\"Error: no test specified\\" && exit 1", "rebuild": "electron-rebuild -f -w bcrypt" }, "build": { "squirrelWindows": { "remoteReleases": "" }, "win": {} }, "devDependencies": { "devtron": "^1.4.0", "electron": "^2.0.2", "electron-builder": "^20.26.1", "electron-packager": "^12.1.0", "electron-prebuilt": "^1.4.13", "electron-rebuild": "^1.8.1", "electron-reload": "^1.2.2", "electron-squirrel-startup": "^1.0.0", "electron-updater": "^2.23.3", "electron-window-state": "^4.1.1", "electron-winstaller": "^2.6.4" }, "dependencies": { "async": "^2.6.1", "bcryptjs": "^2.4.3", "child_process": "^1.0.2", "devtron": "^1.4.0", "express": "^4.16.3", "mysql2": "^1.5.3", "tedious": "^2.6.1", "update-electron-app": "^1.3.0" } } 

並在一段時間內工作正常,我得到了我的exe.file,blockmap文件和Latest.yml,但是當我安裝生成的應用程序時,出現以下錯誤:

松鼠錯誤

我知道此問題是由以下事實造成的:它認為未安裝該應用程序,但是我在做什么錯呢? 到目前為止,我沒有收到任何錯誤。此錯誤的代碼如下:

  <script> //const package = require('./package.json') const remote = require("electron").remote const autoUpdater = remote.autoUpdater autoUpdater.on('update-availabe', () => { console.log('update available') }) autoUpdater.on('checking-for-update', () => { console.log('checking-for-update') }) autoUpdater.on('update-not-available', () => { console.log('update-not-available') }) autoUpdater.on('update-downloaded', (e) => { console.log(e) alert("Install?") autoUpdater.quitAndInstall() }) autoUpdater.setFeedURL('https://xxxxx/x/') autoUpdater.checkForUpdates() window.autoUpdater = autoUpdater </script> 

不確定100%,但是如果package.json文件的字段"name"確實是"////////" ,則可能無效。 例如,根據package.json | npm文檔

該名稱最終成為URL,命令行參數和文件夾名稱的一部分。 因此,名稱不能包含任何非URL安全的字符。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM