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

ModuleNotFoundError: dependency already declared in package.json not usable #65

Open
mtenrero opened this issue Feb 4, 2020 · 7 comments

Comments

@mtenrero
Copy link

mtenrero commented Feb 4, 2020

Hello, this issue would be probably considered as a newbie bozon user question.

I'm having problems using dependencies declared in package.json in the main process js file:

"dependencies": {
    "pouchdb-adapter-leveldb": "^7.1.1",
    "rxdb": "^8.7.5"
  },
  "devDependencies": {
    "bozon": "0.10.7",
    "mocha": "^7.0.0",
    "spectron": "^9.0.0"
  },

The error given is:

× Webpack failed to bundle application
[
  ModuleNotFoundError: Module not found: Error: Can't resolve 'pouchdb-adapter-leveldb' in 'C:\Users\marcostm\Documents\personal\mivet_bozon\src\main'
      at C:\Users\marcostm\scoop\persist\nodejs\bin\node_modules\bozon\node_modules\webpack\lib\Compilation.js:925:10
      at C:\Users\marcostm\scoop\persist\nodejs\bin\node_modules\bozon\node_modules\webpack\lib\NormalModuleFactory.js:401:22
      at C:\Users\marcostm\scoop\persist\nodejs\bin\node_modules\bozon\node_modules\webpack\lib\NormalModuleFactory.js:130:21
      at C:\Users\marcostm\scoop\persist\nodejs\bin\node_modules\bozon\node_modules\webpack\lib\NormalModuleFactory.js:224:22
      at C:\Users\marcostm\scoop\persist\nodejs\bin\node_modules\bozon\node_modules\neo-async\async.js:2830:7
      at C:\Users\marcostm\scoop\persist\nodejs\bin\node_modules\bozon\node_modules\neo-async\async.js:6877:13
      at C:\Users\marcostm\scoop\persist\nodejs\bin\node_modules\bozon\node_modules\webpack\lib\NormalModuleFactory.js:214:25
      at C:\Users\marcostm\scoop\persist\nodejs\bin\node_modules\bozon\node_modules\enhanced-resolve\lib\Resolver.js:213:14
      at C:\Users\marcostm\scoop\persist\nodejs\bin\node_modules\bozon\node_modules\enhanced-resolve\lib\Resolver.js:285:5
      at eval (eval at create (C:\Users\marcostm\scoop\persist\nodejs\bin\node_modules\bozon\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:13:1)
  resolve 'pouchdb-adapter-leveldb' in 'C:\Users\marcostm\Documents\personal\mivet_bozon\src\main'
    Parsed request is a module
@alchaplinsky
Copy link
Collaborator

@mtenrero Try rm -rf node_modules and npm install. Looks like dependency is declared in package.json, but is not present in node_modules.

@mtenrero
Copy link
Author

mtenrero commented Feb 4, 2020

@mtenrero Try rm -rf node_modules and npm install. Looks like dependency is declared in package.json, but is not present in node_modules.

I've also done that, It seem to not be detecting the dependencies....

Probably would be related with webpack?

@alchaplinsky
Copy link
Collaborator

What do you have in your 'webpack.config.js'?

@mtenrero
Copy link
Author

mtenrero commented Feb 4, 2020

Anything..

module.exports = {
  renderer: {},
  preload: {},
  main: {}
}

@alchaplinsky
Copy link
Collaborator

Ok, so webpack should look for imported modules in node_modules directory. Can you confirm that there's pouchdb-adapter-leveldb folder in ./node_modules?

@fawzywassel
Copy link

i have same bug ... any solution ... please

@andrewo0
Copy link

andrewo0 commented Apr 4, 2021

ModuleNotFoundError: Module not found: Error: Can't resolve 'pouchdb-adapter-leveldb'
so if the file is in your node_modules the only issue is your not importing it the correct way

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

4 participants