Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect root path for app globally installed on Mac #28

Open
ghost opened this issue Jul 20, 2018 · 2 comments · May be fixed by #36
Open

Incorrect root path for app globally installed on Mac #28

ghost opened this issue Jul 20, 2018 · 2 comments · May be fixed by #36

Comments

@ghost
Copy link

ghost commented Jul 20, 2018

Using @olsonpm's https://github.com/olsonpm/exampleCLI

I've changed the version of app-root-path to 2.1.0

$ npm install -g exampleCLI-0.1.0.tgz
$ examplecli
root
{ resolve: [Function: resolve],
  require: [Function: require],
  toString: [Function: toString],
  setPath: [Function: setPath],
  path: '/usr/local/lib' }

root.toString()
/usr/local/lib

I expected path to be /usr/local/lib/node_modules/exampleCLI

I notice that the path is a bit different than in #8 , I assume node's default location for global packages has changed since then?

I also checked require('module').globalPaths:

[ '/Users/user-name/.node_modules',
  '/Users/user-name/.node_libraries',
  '/usr/local/Cellar/node/10.7.0/lib/node' ]

and /usr/local/lib/node_modules doesn't appear, could that be throwing things off?

@acunniffe
Copy link

Can confirm I'm getting a similar problem on Linux Mint 18 after moving my node_modules https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally

@thib3113
Copy link

seems to be the same on windows . It's return C:\Users\thib3\AppData\Roaming\npm ( so the path to NPM, and not to the package )

@seognil seognil linked a pull request Jul 3, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants