Skip to content

.npmrc prefix override nvm #606

Closed
Closed
@SeeThruHead

Description

@SeeThruHead
Contributor

symptoms, npm install -g npm installs npm to the wrong directory
overridden by .npmrc

removing "prefix=~/.node" from npmrc fixes the issue

osx ver: osx 10.10.1

zsh ver: zsh 5.0.5 (x86_64-apple-darwin14.0)

.npmrc:
prefix=~/.node

Activity

wilmoore

wilmoore commented on Jan 12, 2015

@wilmoore

I don't believe this is an nvm specific issue.

ljharb

ljharb commented on Jan 12, 2015

@ljharb
Member

I asked @SeeThruHead to file this - the problem as I see it is that nvm (correctly) doesn't respect npm's prefix option, but npm itself will.

I'm not sure how to handle this, but at the least, nvm could print out a warning.

ljharb

ljharb commented on Mar 13, 2015

@ljharb
Member

Noting from #427 that the env var $NPM_CONFIG_PREFIX also causes problems with nvm.

kriswill

kriswill commented on Mar 13, 2015

@kriswill

Maybe detect the nvm config setting upon installation and issue a stern warning?

ljharb

ljharb commented on Mar 13, 2015

@ljharb
Member

I'm considering making nvm refuse any operation whatsoever when problematic settings are set.

kriswill

kriswill commented on Mar 13, 2015

@kriswill

sure, just do a npm config get prefix and if it doesn't contain /.nvm/ then bail out.

ljharb

ljharb commented on Mar 16, 2015

@ljharb
Member

Also $PREFIX, apparently, thanks to #692.

self-assigned this
on Mar 16, 2015
ELLIOTTCABLE

ELLIOTTCABLE commented on Apr 13, 2015

@ELLIOTTCABLE
Contributor

Ugh. Until this is patched, you might want to put a note in the README … I have no idea where my ~/.npmrc came from, but I've been complaining about being unable to update npm for ages. (At least now I know why.)

26 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @ELLIOTTCABLE@ljharb@wilmoore@kriswill@leomoreno

      Issue actions

        .npmrc prefix override nvm · Issue #606 · nvm-sh/nvm