Closed rubenaeg closed 2 years ago
Can repro on a fresh node v17.2.0 install (from official site msi) on windows 11. I installed node on a custom location. <global-dirs>.npm.packages
returns <custom location>\node_modules
, whereas npm list -g
prints C:\Users\<User>\AppData\Roaming\npm
.
I installed vanilla Node.js@v14.18.0 and setup a project with
global-dirs
andoclif
. Essentially I'm trying to access the path where the package will be installed in the end to load additional globally installed plugins, which should beC:\Users\<me>\AppData\Roaming\npm\node_modules\
.On Linux this runs fine, but on Windows the correct
npmrc
cannot be found, thus the default path is used. Node.js now installs the file underC:\Program Files\nodejs\node_modules\npm\
, while installing global modules under%APPDATA%\npm\
.