Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

These dependencies were not found #152

Closed
rakakhrl opened this issue Dec 2, 2018 · 16 comments
Closed

These dependencies were not found #152

rakakhrl opened this issue Dec 2, 2018 · 16 comments

Comments

@rakakhrl
Copy link

rakakhrl commented Dec 2, 2018

Describe the bug
After installing knex and serving the app i got an error saying "These dependencies were not found"

To Reproduce

  • Create a new project
  • Install knex and mysql driver npm install --save knex mysql
  • Run npm run electron:serve

Expected behavior
Electron app boot up and work normally

Screenshots
gambar

Environment (please complete the following information):

  • OS and version: Windows 10
  • node version: 8.11.2
  • npm version: 6.4.1
  • vue-cli-plugin-electron-builder version : ^1.0.0-rc.9
  • electron version: ^2.0.0
  • other vue plugins used: [@vue/cli-plugin-babel, @vue/cli-plugin-eslint, @vue/eslint-config-prettier]
  • custom config for vcp-electron-builder:

Additional context

@nklayman
Copy link
Owner

nklayman commented Dec 3, 2018

knex is looking for mssql, not mysql 🤦‍♂️. Run npm i mssql to resolve this issue 👍.

@nklayman nklayman closed this as completed Dec 3, 2018
@rakakhrl
Copy link
Author

rakakhrl commented Dec 3, 2018

I already install mssql and other db driver like pg and mysql2 but still got the same error. Before i create an issue here i create one in knex repo but they say its not knex related bug and told me i should ask here.

I also try to clone the electron-quick-start repo and install knex and mysql, and have no problem when i serve the app.

@nklayman
Copy link
Owner

nklayman commented Dec 4, 2018

After installing mssql, it works fine for me.

@nklayman
Copy link
Owner

nklayman commented Dec 4, 2018

Try with a fresh project.

@chen-xin
Copy link

chen-xin commented Mar 3, 2019

I have same issue, tried this solution but no luck. It seems the only solution is to install all modules in the not found list, though my app use sqlite3 only.

@nklayman
Copy link
Owner

nklayman commented Mar 3, 2019

@chen-xin Make sure to mark sqlite3 as an external:

// vue.config.js
module.exports = {
  pluginOptions: {
    electronBuilder: {
      externals: ['sqlite3'],
      // If you are using Yarn Workspaces, you may have multiple node_modules folders
      // List them all here so that VCP Electron Builder can find them
      nodeModulesPath: ['../../node_modules', './node_modules']
    }
  }
}

@chen-xin
Copy link

chen-xin commented Mar 3, 2019

Thank you @nklayman, Now I am luck! And you are so warmhearted mentioning the Yarn part, this really enlightened me.

@krisism
Copy link

krisism commented Feb 3, 2020

I have recently stumbled upon the same issue, searched and tried everything I can find or think of -- without success. I'm attempting to use this wonderful plugin, along with knex and sqlite3, the same as above. I can't seem to get past this error without installing all the modules.

To recreate the exact scenario, here are the steps I've taken:

  1. Install cli
  2. create project and cd to directory
  3. Add plugin
  4. yarn add knex
  5. yarn add sqlite3
  6. in background.js, added knex with example code:
    var knex = require('knex')({ client: 'sqlite3', connection: { filename: databaseLocation } });
  7. create a vue.config.js file in the project root (beside package.json), added sqlite3 in externals and tried with (and without) nodeModulesPath.

Then when running 'yarn electron:serve' it still triggers the error. Is there anything obvious I'm missing? If anyone has advice, or ideas to try, I'm all ears!

@nklayman
Copy link
Owner

nklayman commented Feb 5, 2020

@krisism Have you tried adding knex as an external in vue.config.js?

@krisism
Copy link

krisism commented Feb 5, 2020

That did the trick, thank you so much for that tip @nklayman . You're a gentleman and a scholar.

@yuredev
Copy link

yuredev commented May 17, 2020

i having the same issue trying but trying to using knex with mysql. i already tried to add knex and mysql as an external in vue.config.js but still not works. (english is not my first language)

externals

@nklayman
Copy link
Owner

@Yurematias try adding ./node_modules to the nodeModulesPath array.

@yuredev
Copy link

yuredev commented May 17, 2020

I tried but still not works
print electron-builder

@yuredev
Copy link

yuredev commented May 17, 2020

The error was mine, i created the vue.config.js in the wrong place, but i moved for the root and followed your tip and resolved. thank you so much bro.

@Yemesoft
Copy link

image
Please referto the issue below:
puppeteer/puppeteer#9467

@Yemesoft
Copy link

puppeteer-demo.zip
It's the project file, electron + vue3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants