Cli: [BUG] `prefix`-sub-command and global installes ignore configured prefix

Created on 2 Sep 2020  路  2Comments  路  Source: npm/cli

Current Behavior:


the sub-command npm prefix logs /usr/local and that's also where it tries to make global installs (obviously raising an EACCES error).
for other things, options are correctly resolved eg. npm config <command> -g will access the corect configs

Expected Behavior:


global installs going to the folder specified in prefix

Steps To Reproduce:

  • have a prefix defind in the configs
  • run npm i <@some/package> -g
  • Environment:

  • OS: macOS Catalina 10.15.6
  • Node: 14.8.0
  • npm: v7-beta.8
  • Bug Release 7.x beta

    All 2 comments

    should have been fixed in v7.0.0-beta.11 please let us know if you get a chance to try it again 馃槉

    @ruyadorno looks like it works.

    Now I finally don't have to use npm exec npm install <pkg> -g anymore. It looked especially ridiculous when installing the subsequent npm-beta version.

    Was this page helpful?
    0 / 5 - 0 ratings