You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've just recently started using nvm to help facilitate testing npm packages against multiple versions of Node. I quickly ran into issues with updating my global install of npm, only to discover pretty quickly what was causing my problem, i.e. #606 helped. I followed the instructions in that issue so that I could bring my local environment inline with what seems like best practice.
Unfortunately I kept running into the same issue. npm install -g npm kept installing into my prefix directory, but calls to npm kept referencing the nvm-managed node directory.
Following some helpful hints provided in other issues I discovered that npm actually checks for, and uses, the PREFIX environmental variable.
For example I have the following in my profile script:
So technically there is a workaround, use another name for my PREFIX variable. However, before going down that path I wanted to see if maybe I was missing something in my environment, or if there was a way I could keep using PREFIX.
The text was updated successfully, but these errors were encountered:
I've just recently started using
nvm
to help facilitate testing npm packages against multiple versions of Node. I quickly ran into issues with updating my global install ofnpm
, only to discover pretty quickly what was causing my problem, i.e. #606 helped. I followed the instructions in that issue so that I could bring my local environment inline with what seems like best practice.Unfortunately I kept running into the same issue.
npm install -g npm
kept installing into my prefix directory, but calls tonpm
kept referencing thenvm
-managed node directory.Following some helpful hints provided in other issues I discovered that
npm
actually checks for, and uses, the PREFIX environmental variable.For example I have the following in my profile script:
I use that environmental variable for convenience. Next, I query
npm
to get the prefix directory it's using for installing npm packages.As you can see, it's using the value of my
$PREFIX
environmental variable.So my assumption was that if I unset that variable
npm
would use the correct directory.Which it turns out it did:
So technically there is a workaround, use another name for my
PREFIX
variable. However, before going down that path I wanted to see if maybe I was missing something in my environment, or if there was a way I could keep usingPREFIX
.The text was updated successfully, but these errors were encountered: