nklayman / vue-cli-plugin-electron-builder

Easily Build Your Vue.js App For Desktop With Electron

Home Page:https://nklayman.github.io/vue-cli-plugin-electron-builder/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: Cannot find module 'vue-cli-plugin-electron-builder/lib'

mcfaith9 opened this issue · comments

After installing my app and opening it I got this error

Error: Cannot find module 'vue-cli-plugin-electron-builder/lib'
Require stack: - C:\Users\--\AppData\Local\Programs\AGuyIKnowTimeTracker\Resources\app.asar\src\background.js

Here's my package.json

{
    "name": "vue-timetracker",
    "version": "0.1.2",
    "private": true,
    "author": "---",
    "productName": "---",
    "description": "---",
    "scripts": {
        "serve": "vue-cli-service serve",
        "build": "vue-cli-service build",
        "lint": "vue-cli-service lint",
        "build-installer": "electron-builder",
        "electron:build": "vue-cli-service electron:build",
        "electron:serve": "vue-cli-service electron:serve",
        "postinstall": "electron-builder install-app-deps",
        "postuninstall": "electron-builder install-app-deps"
    },
    "main": "src/background.js",
    "dependencies": {
        "@electron/remote": "^2.0.9",
        "@headlessui/vue": "^1.7.13",
        "@vueuse/core": "^10.1.2",
        "autoprefixer": "^10.4.14",
        "axios": "^1.4.0",
        "core-js": "^3.8.3",
        "postcss": "^8.4.23",
        "tailwindcss": "^3",
        "uninstall": "0.0.0",
        "vue": "^3.2.13"
    },
    "devDependencies": {
        "@babel/core": "^7.12.16",
        "@babel/eslint-parser": "^7.12.16",
        "@vue/cli-plugin-babel": "~5.0.0",
        "@vue/cli-plugin-eslint": "~5.0.0",
        "@vue/cli-service": "~5.0.0",
        "electron": "^13.6.9",
        "electron-devtools-installer": "^3.1.0",
        "eslint": "^7.32.0",
        "eslint-plugin-vue": "^8.0.3",
        "vue-cli-plugin-electron-builder": "~2.1.1",
        "vue-cli-plugin-tailwind": "~3.0.0"
    },
    "eslintConfig": {
        "root": true,
        "env": {
            "node": true
        },
        "extends": [
            "plugin:vue/vue3-essential",
            "eslint:recommended"
        ],
        "parserOptions": {
            "parser": "@babel/eslint-parser"
        },
        "rules": {}
    },
    "browserslist": [
        "> 1%",
        "last 2 versions",
        "not dead",
        "not ie 11"
    ],
    "build": {
        "appId": "---",
        "win": {
            "target": [
                "nsis"
            ],
            "icon": "src/assets/img/icon.ico",
            "requestedExecutionLevel": "requireAdministrator"
        },
        "nsis": {
            "installerIcon": "src/assets/img/icon.ico",
            "uninstallerIcon": "src/assets/img/icon.ico",
            "uninstallDisplayName": "---",
            "license": "LICENSE.md",
            "oneClick": false,
            "allowToChangeInstallationDirectory": true
        }
    }
}

image

If i try to uncomment this const { createProtocol } = require('vue-cli-plugin-electron-builder/lib') it will succesfully installed and can be open, but the app is blank

Resolve it, just fix my package.json and some code inside my background.js