gun icon indicating copy to clipboard operation
gun copied to clipboard

[Bug][npm install] Instalation of gun fails using npm

Open flammehawk opened this issue 4 years ago • 5 comments

Greetings,

I just tried to install gun through the usage of npm install gun and I get the attached error.

eresolve-report.txt

flammehawk avatar Mar 05 '21 10:03 flammehawk

I had this problem too. There seems to be a conflict in dependencies used in the examples (specifically react/react native), which for some reason gun bundles in the npm package.

I used npm install gun --legacy-peer-deps as suggested by npm, which worked.

adamstaveley avatar Mar 12 '21 10:03 adamstaveley

question is should the examples even be included inside the npm package

ghost avatar Mar 12 '21 10:03 ghost

npm add gun --save
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR!   peer react@">=16.4" from @gooddollar/[email protected]
npm ERR!   node_modules/@gooddollar/react-native-webview-crypto
npm ERR!     peer @gooddollar/react-native-webview-crypto@"^0.*" from [email protected]
npm ERR!     node_modules/gun
npm ERR!       gun@"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.1" from [email protected]
npm ERR! node_modules/react-native
npm ERR!   peer react-native@">=0.56" from @gooddollar/[email protected]
npm ERR!   node_modules/@gooddollar/react-native-webview-crypto
npm ERR!     peer @gooddollar/react-native-webview-crypto@"^0.*" from [email protected]
npm ERR!     node_modules/gun
npm ERR!       gun@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!

is the error I'm getting. I don't click links to files, so I wanted to paste that here for posterity :)

metagrapher avatar Mar 29 '21 12:03 metagrapher

It looks like @adamstaveley 's workaround does indeed work, though I feel uneasy about it with the deprecated text-encoding package...it's just a warning and it's not a security risk per se.

This does bear some attention though, I would think, in spite of this workaround. Probably, yes, don't need the examples in the npm package.

metagrapher avatar Mar 29 '21 12:03 metagrapher

@metagrapher @flammehawk @adamstaveley hmm, GitHub is no longer emailing me about issues? Sorry I haven't seen this.

Yeah... IDK why npm is trying to install optional (non necessary, purely optional) dependencies, this is super annoying. By chance is this fixed if you do it from GitHub master?

amark avatar Apr 01 '21 07:04 amark