Giter Club home page Giter Club logo

Comments (5)

felixrieseberg avatar felixrieseberg commented on May 13, 2024

Hey, if you didn't attempt to install npm with npm install -g npm, everything is fine. Even if you did, things are still okay - Windows will however use the npm installed with Node.js instead, since the official Node.js installer references the Node directory in PATH before the global AppData directory.

This installer is trying to minimally invasive and upgrade the npm version inside the Node.js folder (which should be the one installed used anyway, unless the user provisioned npm or node him/herself.)

If Windows is already using the one in %appdata%\npm\node_modules\npm, the installer is actually not required - and a simple npm install -g npm@latest is enough to upgrade.

Does that make sense? Or did I misunderstand you?

from npm-windows-upgrade.

BarryThePenguin avatar BarryThePenguin commented on May 13, 2024

I have used npm install -g npm, the main issue with this method is the npmrc file gets removed during the install. This breaks npm until you replace the npmrc file.

If this tool was only meant to upgrade npm in the Node.js folder and nodejs\node_modules\npm is the npm instance we should be using, I'm happy with that as the solution 👍

from npm-windows-upgrade.

felixrieseberg avatar felixrieseberg commented on May 13, 2024

Good point. I don't want to put myself or Microsoft into the position of telling people how to use npm. I can probably get the path of the npm installation used and update that one.

from npm-windows-upgrade.

cchamberlain avatar cchamberlain commented on May 13, 2024

If I am understanding everything correct, I believe the pull request I sent that was integrated should be causing the default behavior now to first query the first npm in your path for its global install location via -
npm config --global get prefix

I'd expect this to return the AppData path if that's the install you have, although my current setup is installed at another location within my home directory so I can't test that assumption very well at the moment. Perhaps this issue is fixed?

from npm-windows-upgrade.

felixrieseberg avatar felixrieseberg commented on May 13, 2024

I assume this issue is fixed no - if we fail with installing npm in AppData, we're now also installing the desired version in the NodeJS folder. I'll close this as fixed.

Thanks everybody!

from npm-windows-upgrade.

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.