Start the error report after packaging with electron-builder:
Reading /xxx/manifest.json failed.
Error: ENOENT: no such file or directory, open '/xxx/manifest.json'
at Object.fs.openSync (fs.js:558:18)
at Object.module.(anonymous function) [as openSync] (ELECTRON_ASAR.js:173:20)
at Object.fs.readFileSync (fs.js:468:33)
at Object.fs.readFileSync (ELECTRON_ASAR.js:506:29)
at getManifestFromPath (/xxx/node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/browser/chrome-extension.js:34:26)
at Function.BrowserWindow.addDevToolsExtension (/xxx/node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/browser/chrome-extension.js:373:22)
at App.Z.enabled.X.on (/xxx/webpack:/~/electron-debug/index.js:78:1)
at emitTwo (events.js:111:20)
at App.emit (events.js:191:7)
Solution:
1. Execute the following command:
npm install vue-devtools --global
2. Modify src/main/index.dev.js as follows:
import { BrowserWindow } from 'electron'; //Add
/* eslint-disable */
// Install `electron-debug` with `devtron`
// require('electron-debug')({ showDevTools: true })
require('electron-debug')() //Modify
// Install `vue-devtools`
require('electron').app.on('ready', () => {
let installExtension = require('electron-devtools-installer')
//Comment out
// installExtension.default(installExtension.VUEJS_DEVTOOLS)
// .then(() => {})
// .catch(err => {
// console.log('Unable to install `vue-devtools`: \n', err)
// })
//Add
BrowserWindow.addDevToolsExtension('node_modules/vue-devtools/vender')
})
// Require `main` process to boot app
require('./index')
3. Recompile:
npm run build:win32
4. Repackage:
electron-builder
It can start normally:
Read More:
- [Solved] electron project Package Error: spawn exe\dll ENOENT
- [Solved] Error: ENOENT: no such file or directory, scandir ‘..\node_modules\node-sass\vendor‘
- [Solved] VUE npm install Error: Module build failed: Error: ENOENT: no such file or directory, scandir
- [Solved] electron Use remote Error: Cannot read properties of undefined (reading ‘BrowserWindow‘)
- [Solved] electron Error: Uncaught TypeError: Cannot read property ‘BrowserWindow‘ of undefined
- How to Solve MAC electronic installation dependent startup error
- [Solved] Uncaught Error: @electron/remote is disabled for this WebContents
- [Solved] electron-vue project error: Object.fromEntries is not a function electron-vue
- [Solved] Syntax Error: no such file or directory, open ‘F:\webProjectStudy\webProjectStudy\newStudy\24.d
- [Solved] fatal error: cuda_runtime.h: No such file or directory
- [Solved] Warning: To load an ES module, set “type“: “module“ in the package.json or use the .mjs extension
- [Solved] VS Code Error: Vetur can‘t find ‘tsconfig.json‘ or ‘jsconfig.json‘
- [Solved] ERROR Error: Cannot find module ‘vue-loader-v16/package.json‘
- [Solved] Parsing error: No Babel config file detected for XXX
- The vue3 project Error: Cannot find module’vue-loader-v16/package.json’
- [Solved] Vue Error: Parsing error: No Babel config file detected for /Users/Usename/xxx…
- [Solved] Vue Error: Parsing error:No Babel config file detected for xxx
- [Solved] Error: Cannot find module ‘vue-template-compiler/package.json‘ Require stack:
- [Solved] TypeError: Converting circular structure to JSON – JSON.stringify
- package.json Scripts configuration environment variable distinguishes development environment from production environment