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

Feature request: flag for not changing npm version #396

Open
7 of 29 tasks
Ashniu123 opened this issue Sep 26, 2018 · 2 comments
Open
7 of 29 tasks

Feature request: flag for not changing npm version #396

Ashniu123 opened this issue Sep 26, 2018 · 2 comments

Comments

@Ashniu123
Copy link

If this is a question about how to use NVM4W, please use stackoverflow instead.

If this is an issue regarding antivirus, make sure you search the existing issues first.

My Environment

  • Windows 7 or below (not truly supported due to EOL - see wiki for details)

  • Windows 8

  • Windows 8.1

  • Windows 10

  • Windows 10 IoT Core

  • Windows Server 2012

  • Windows Server 2012 R2

  • Windows Server 2016

  • My Windows installation is non-English.

I'm using NVM4W version:

  • 1.1.7
  • 1.1.6
  • 1.1.5
  • 1.1.4
  • 1.1.3
  • 1.1.2
  • 1.1.1
  • Older
  • OTHER (Please Specify)

I have already...

  • read the README to be aware of npm gotchas & antivirus issues.
  • reviewed the wiki to make sure my issue hasn't already been resolved.
  • verified I'm using an account with administrative privileges.
  • searched the issues (open and closed) to make sure this isn't a duplicate.
  • made sure this isn't a question about how to use NVM for Windows, since gitter is used for questions and comments.

My issue is related to (check only those which apply):

  • settings.txt
  • proxy support (Have you tried version 1.1.0+?)
  • 32 or 64 bit support (Have you tried version 1.1.3+?)
  • Character escaping (Have you tried version 1.1.6+?)
  • A standard shell environment (terminal/powershell)
  • A non-standard shell environment (Cmder, Hyper, Cygwin, git)

Feature request

Can there be an additional flag(like --no-npm) while installing (like nvm install 8.11.4 64 --no-npm) because suppose I switch from 8.12.0 to 8.11.4 for example, npm 6.4.1 will work for both but still nvm installs npm 5.6, which seems unnecessary.
Or maybe use the flag while doing nvm use 8.11.4 --no-npm to use the current npm and not change it.

Perhaps there could be a better flag name which collaborators can suggest instead of --no-npm.

If collaborators agree to this feature, I can work on it and make a PR.

@coreybutler
Copy link
Owner

Interesting proposal. I'm open to discussing this.

I think the challenge will be isolation and architecture (bitness). Right now, npm is installed directly within each node installation's root folder. A straight copy of npm from one version of node to another might work, though I'm weary of edge cases with native module compilation.

To me, it seems like the same approach used for node might work for npm.... i.e. symlinks. Node and npm could potentially be saved in separate directories, with a symlink in each node install to the version of npm the user wants to use.

- npm Installs
  |_ v5.6.1
  |_ v5.6.2
- Node Installs
  |_ Node Root
     |_ symlink --> npm installs\v5.61

The catch is when multiple versions of node point to the same version of npm (again, with native modules being the challenge), potentially rebuilding dependencies. This was the major reason why there was never a "global" node_modules directory. I'm not sure how to get around that part.

@KrauseStefan
Copy link

Having the ability to select an other release version of npm would definitely be useful.
I would however suggest using a specific version instead of the no npm.
Something like nvm install 10.16.0 --npm 6.10.0
The way npm is installed at the moment does not allow for an easy upgrade of npm.
https://docs.npmjs.com/try-the-latest-stable-version-of-npm

Even if it did that would mean we had to install npm twice (bundled version and desired version)

Npm claim to be compatible with all current versions of nodejs anyway, risk should be small.
https://blog.npmjs.org/post/165273023140/supported-nodejs-versions-in-the-npm-cli

Is this something that you would be interested in a pull request for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants