Repository navigation
Can't install with NPM (Workaround: use yarn instead) #5174
Description
Activity
- addedbugSomething isn't workingSomething isn't workingtriageThis issue needs to be triaged by a maintainerThis issue needs to be triaged by a maintainer
on May 6, 2022 Installing yarn via
npm install -g yarnand runningsudo yarn global add code-serverworks however.Reacted by Mistry SiddhReacted by mh166 and JiwonInteresting! I wonder why it works with
yarnand notnpm? Any ideas by chance @edvincent ?I wonder why it works with
yarnand notnpmBecause
yarndoesn't respect ANY lockfiles when installing something globally (and anyway when runningyarn publish, files likeyarn.lockget deleted.Why it started failing now is likely because of the Node 14 => 16 transition... And indirectly the fact that I completely forgot to finish #5071... Which partly was because we were trying to find a "perfect" solution...
I won't get around today, but let me update that PR by tomorrow with something to unblock, and maybe we can iterate through a better solution over PRs.
Maybe we should rename this current issue "Can't install with NPM" (with a workaround being "Use yarn") until then?
And a new PR linked to this issue would likely be part of the CI workflows doing an "npm install ARTIFACT" - to catch these?
Reacted by Jiwon and wangyaoqinReacted by Joe Previte and Jiwon- changed the title
[-][Bug]: Could not find module 'node-addon-api' when running 'sudo npm i -g code-server'[/-][+]Can't install with NPM (Workaround: use yarn instead)[/+]on May 9, 2022 Ah right @edvincent! Haha no worries at all. There has certainly been a lot of back and forth. I'll keep an eye on your PR.
I was able to get it to build on a Raspberry Pi 4 using the latest npm@^6. I had problems with npm@8.
Reacted by Joe PreviteI had the same problem, but I solved it using yarn too.
https://coder.com/docs/code-server/latest/install#raspberry-pi
Would you link this issue to the document above?🙏I think #5071 should resolve this.
PRs welcome to make any doc changes 🙏🏼
I think #5071 should resolve this.
PRs welcome to make any doc changes 🙏🏼
Thank you and I did request the PR
Reacted by Joe Previte- added a commit that references this issue
on Aug 1, 2022 Confirmed locally with the artifacts from #5071 that code-server can be installed (again) with
npm.Currently it will be in the same state as when using
yarn(due to npm/cli#5325): it will use whatever versions of dependencies are the latest at install time.Reacted by Joe Previte- removedtriageThis issue needs to be triaged by a maintainerThis issue needs to be triaged by a maintainer
on Aug 22, 2022 Seems to install all good as expected now :D
ubuntu@ip-172-26-6-151:~$ npm install -g --unsafe-perm code-server@4.6.0-beta-90f603549adbcbb608041fda2138265523ff0353 added 211 packages, and audited 212 packages in 1m 12 packages are looking for funding run `npm fund` for details found 0 vulnerabilitiesReacted by Joe Previte and JiwonAnd as a good news, the bug from npm/cli#5325 doesn't seem to affect remote installs (I obviously was only testing with local packages), so the
npminstall is fully deterministic.argon2was the thing I kept looking at - which installed correctly withargon2@0.28.4rather than the latestargon2@ 0.28.7(which I had trouble with when installing locally).Reacted by Joe Previte, Jiwon and AsherSeems to install all good as expected now :D
woohoo! @edvincent should we close this now?
Closing this since #5071 was merged.
Is there an existing issue for this?
OS/Web Information
code-server --version: 4.4.0Running on Raspberry Pi 4 on Ubuntu 20.10
Steps to Reproduce
sudo npm i -g code-serverExpected
code-server should install and NPM should not log any errors.
Actual
NPM gives an installation error.
Logs
Screenshot/Video
No response
Does this issue happen in VS Code?
Are you accessing code-server over HTTPS?
Notes
Node Version: 16.15.0
NPM Version: 8.5.5
Running on a Raspberry Pi 4