GithubHelp home page GithubHelp logo

Install bundled version of npm about proto HOT 4 CLOSED

moonrepo avatar moonrepo commented on May 19, 2024
Install bundled version of npm

from proto.

Comments (4)

milesj avatar milesj commented on May 19, 2024

Yeah can definitely support this.

from proto.

TimonVS avatar TimonVS commented on May 19, 2024

I've been trying this locally. Installing the bundled version of npm works!

Currently, when you have a newer version of npm installed (e.g., you ran proto install npm), and you're using .nvmrc/.node-version, Proto will use the latest version of npm that you have installed. In contrast, nvm and Volta will use the bundled version of npm by default. E.g., Volta:

$ volta install node@16
success: installed and set [email protected] (with [email protected]) as default
$ node -v
v16.19.1
$ npm -v
8.19.3

$ volta install [email protected]
success: installed and set [email protected] (with [email protected]) as default
$ node -v
v16.14.2
$ npm -v
8.5.0

vs Proto:

$ cat .nvmrc
v16.14.2
$ proto install node
[INFO  proto:install] Installing Node.js with version "latest"
[INFO  proto:install] Node.js has been installed at /Users/timon.vanspronsen/.proto-2/tools/node/19.8.0!
[INFO  proto:install] Installing npm with version "bundled"
[INFO  proto:install] npm has been installed at /Users/timon.vanspronsen/.proto-2/tools/npm/9.5.1!

$ proto install node 16.14.2
[INFO  proto:install] Installing Node.js with version "16.14.2"
[INFO  proto:install] Node.js has been installed at /Users/timon.vanspronsen/.proto-2/tools/node/16.14.2!
[INFO  proto:install] Installing npm with version "bundled"
[INFO  proto:install] npm has been installed at /Users/timon.vanspronsen/.proto-2/tools/npm/8.5.0!
$ node -v
v16.14.2
$ npm -v
9.5.1

With Volta you can still install a newer version of npm, from then on it will use this newer version, but you can switch back by running volta install npm@bundled (and from then on it will use the bundled version for any version of Node that you install).

$ volta install node@16
success: installed and set [email protected] as default
$ npm -v
8.19.3
$ volta install npm@9
success: installed and set [email protected] as default
$ volta install node@16
success: installed and set [email protected] as default
$ npm -v
9.6.1
$ volta install npm@bundled
success: set bundled npm (currently 8.5.0) as default
$ volta install [email protected]
success: installed and set [email protected] (with [email protected]) as default
$ npm -v
8.5.0

I realize that this is a very hard (UX) problem, I personally like what Volta has done to solve the problem. What are your thoughts?

from proto.

milesj avatar milesj commented on May 19, 2024

Thanks for testing it before it's been released!

This should definitely be doable. The only issue is that engines or packageManager would take precedent if they have an explicit version. Bundled would only really work as the "last case".

from proto.

milesj avatar milesj commented on May 19, 2024

Released 0.3

from proto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.