chenasraf / fp-max-extension

Floatplane enhancements chromium extension
https://casraf.dev
MIT License
7 stars 0 forks source link

npm install fails #1

Closed jahands closed 1 year ago

jahands commented 1 year ago

Heya! Thanks again for making this :) I tried to build this extension locally, but had an error when running npm i. Any idea what's going on here? Thanks!

$ npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: fp-max-extension@0.1.0
npm ERR! Found: vite@4.2.1
npm ERR! node_modules/vite
npm ERR!   dev vite@"^4.2.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer vite@"^2.9.0" from @crxjs/vite-plugin@1.0.14
npm ERR! node_modules/@crxjs/vite-plugin
npm ERR!   dev @crxjs/vite-plugin@"^1.0.14" 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! 
npm ERR! See /home/jh/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/jh/.npm/_logs/2023-03-26T14_47_27_388Z-debug-0.log

System info

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:        22.04
Codename:       jammy

$ node -v
v16.16.0
chenasraf commented 1 year ago

Hi @jahands, sorry for the trouble! I'm not exactly sure why this happens -

Can you try the following and see if it works?

  1. Remove node_modules directory rm -rf node_modules
  2. Set this config npm config set legacy-peer-deps true
  3. Install dependencies again npm install

If the above doesn't work, can you try to install using the yarn package manager? It is what I use. If that works, it might help narrow the problem down.

npm i -g yarn # install yarn globally
yarn install # install project dependencies
chenasraf commented 1 year ago

I tested the npm config command and it seems to fix it. I updated package-lock.json so pulling the new version might cause you not to need that fix, but if it still causes an error this should fix it.

Let me know how it works out for you