jonschlinkert / global-prefix

Get the npm global path prefix. Same code used internally by npm.
MIT License
28 stars 12 forks source link

still fails on windows (AppVeyor) #18

Closed tunnckoCore closed 7 years ago

tunnckoCore commented 7 years ago

While updating https://github.com/tunnckoCore/detect-installed i get red in AppVeyor.

Started debugging with console.log-ing the joined filepath and the path that comes from global-modules (so global-prefix). https://github.com/tunnckoCore/detect-installed/issues/8

If this helps https://ci.appveyor.com/project/tunnckoCore/detect-installed/build/1.0.13 ... Or in short: that's C:\Users\appveyor\AppData\Roaming\npm\node_modules the path that global-modules returns. Don't know if it is correct.

doowb commented 7 years ago

https://www.appveyor.com/docs/lang/nodejs-iojs/#how-that-works

That page has information that indicates that's where the global node_modules folder is on appveyor. I see that you have tests in detect-installed that look to see if npm is installed. It looks like appveyor doesn't explicitly npm i npm -g so the npm used is under the nodejs/node_modules folder instead of the global npm/ node_modules folder.

I would add a build step in your .appveyor.yml that explicitly installs npm (or some other global module) then test for that to ensure it's correct.

jonschlinkert commented 7 years ago

@doowb that's great info for the readme here. I can add next time I get a chance, or if you or @tunnckoCore wants to that would be great too

tunnckoCore commented 7 years ago

@doowb super, I'll try it and will send a PR if it works. Thanks.

tunnckoCore commented 7 years ago

Great, it worked for me. Thanks again @doowb.