bozon
bozon copied to clipboard
ModuleNotFoundError: dependency already declared in package.json not usable
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
@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 Try
rm -rf node_modules
andnpm install
. Looks like dependency is declared in package.json, but is not present innode_modules
.
I've also done that, It seem to not be detecting the dependencies....
Probably would be related with webpack?
What do you have in your 'webpack.config.js'?
Anything..
module.exports = {
renderer: {},
preload: {},
main: {}
}
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
?
i have same bug ... any solution ... please
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