Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add npm package to make code-server super simple to install #1396

Closed
nhooyr opened this issue Mar 5, 2020 · 10 comments
Closed

Add npm package to make code-server super simple to install #1396

nhooyr opened this issue Mar 5, 2020 · 10 comments
Labels
enhancement Some improvement that isn't a feature

Comments

@nhooyr
Copy link
Contributor

nhooyr commented Mar 5, 2020

No description provided.

@nhooyr nhooyr added the enhancement Some improvement that isn't a feature label Mar 5, 2020
@nhooyr nhooyr changed the title Add npm package to code-server super simple to install Add npm package to make code-server super simple to install Mar 5, 2020
@nhooyr
Copy link
Contributor Author

nhooyr commented Mar 5, 2020

See #1306

@brandonkal
Copy link

Please don't use npm for global binaries.

@nhooyr
Copy link
Contributor Author

nhooyr commented Mar 15, 2020

Can you elaborate?

@brandonkal
Copy link

There are better options. In Linux we have apt-get. In macOS and Linux we have Homebrew.

  • npm installs are slow.
  • npm is non-deterministic
  • The package is not signed. This is a big issue.
  • The only integrity check performed is a basic SHA1 hash, which is a security risk when installing system-wide apps.
  • Upgrades are not handled the same way as all other software on your system (apt-get upgrade)
  • The track record isn't great
  • It's insecure and not designed for global packages. In Homebrew I can look at the actual formula file. With npm you are downloading a tarball from some server which then runs any arbitrary code. Nothing is stopping people from packaging different minimized code than what is in GitHub.

Given all the above, even a shell script would be better.

@nhooyr
Copy link
Contributor Author

nhooyr commented Mar 16, 2020

I think there's some confusion. This issue isn't about making it the sole way to distribute code-server. We'll still keep our releases, docker images and work towards deb/rpm packages #1395. Having an npm package just reduces friction for users who want to try it out.

@michael-dm
Copy link

Hello @nhooyr, do you know when this issue might be addressed ? I'd like to install coder on alpine and it seems npm would be the simplest way.

@brandonkal
Copy link

There's no confusion here. Releasing an npm package just encourages bad practices and there's not a case where it would be easier for your users vs using a proper package manager or a simple install shell script.

@micodeyt why bother? Code Server + a reasonable amount of extensions will put you at about 1-2 GB. Support more than one language, and that grows more. At that point, why go through the hassle of using Alpine for your base image to save 7 MB?
If you throw in adding npm to then install code server, you've already lost the small size advantage that is Alpine.

@nhooyr
Copy link
Contributor Author

nhooyr commented Apr 30, 2020

There's no confusion here. Releasing an npm package just encourages bad practices and there's not a case where it would be easier for your users vs using a proper package manager or a simple install shell script.

A proper package manager is always better yes, but npm/node is everywhere. Compared to a shell script, you can easily uninstall, list installed global binaries etc and have it already in your $PATH so it is an improvement.

We're still moving forward with the Debian releases/repo and a PPA but this will be a nice crutch for when you just want to quickly install.

You can test it out now:

yarn global add code-server

@gyzerok
Copy link

gyzerok commented May 13, 2020

For me the build is failing on installation.

Have you considered installing already built version with npm/yarn? That would also make installation faster.

@nhooyr
Copy link
Contributor Author

nhooyr commented May 17, 2020

@gyzerok Can you try again, it's been merged and in the README.md now: https://github.com/cdr/code-server#npm

Re installing build versions with npm/yarn see #1641

@nhooyr nhooyr closed this as completed May 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Some improvement that isn't a feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants