nathanbuchar / electron-settings

📝 A simple persistent user settings framework for Electron.
https://electron-settings.js.org
MIT License
814 stars 60 forks source link

Cannot find module 'electron-settings' #142

Closed Ucag closed 3 years ago

Ucag commented 3 years ago

I'm working with vue and electron. Everything goes fine in development, however, when it comes to package my app this error occurred.

Cannot find module 'electron-settings'

I double checked that electron-settings is right in my package.json dependencies field. I require it like this

const settings = window.require('electron-settings')

I also have tried:

const settings = remote.require('electron-settings')

But not working....

This is my package.json

  "dependencies": {
    "core-js": "^3.6.5",
    "electron-settings": "^4.0.2",
    "raw-loader": "^4.0.2",
    "vue": "^2.6.11"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "electron": "^9.0.0",
    "electron-devtools-installer": "^3.1.0",
    "vue-cli-plugin-electron-builder": "~2.0.0-rc.5",
    "vue-template-compiler": "^2.6.11"
  }
bkervaski commented 1 year ago

Same, using electron-forge. What did you do to fix?