Hello everyone,
In the process of attempting to create a template of electron-react-boilerplate with ipfs-core (currently a work in progress), I run into a curious problem.
If you clone the above repo, make sure that ipfs-core is NOT listed as a dependency (nor a devDependency) in package.json, then run:
npm install
npm install ipfs-core
npm start
then I see the app working as intended. (It’s a one page app that simply displays peerID and version info for your javascript ipfs node.) After the installation of ipfs-core, in package.json, I see, as expected:
"ipfs-core": "^0.17.0",
However, if I manually place ipfs-core into package.json as a dependency prior to the initial installation step, then when I try to install, I get the error:
Webpack does not work with native dependencies.
ipfs-core is a native dependency and should be installed inside of the "./release/app" folder.
First, uninstall the packages from "./package.json":
npm uninstall your-package
Then, instead of installing the package to the root "./package.json":
npm install your-package
Install the package to "./release/app/package.json"
cd ./release/app && npm install your-package
Read more about native dependencies at:
https://electron-react-boilerplate.js.org/docs/adding-dependencies/#module-structure
This is strange because ipfs-core is written in javascript, and by my understanding, native dependencies are the ones that are NOT written in javascript. So is npm miscategorizing ipfs-core for some reason?
I’ve tried doing the things your’re supposed to do in electron-react-boilerplate for native dependencies:
cd release/app
npm install ipfs-core
npm run postinstall
cd ../..
npm start
but I haven’t gotten that to work in the app.
I’m a novice when it comes to electron and native dependencies, so it’s very possible I’m misunderstanding something.
Thank you in advance for any insights you may have!