Skip to content

Incorrect root path for app globally installed on Mac #28

@ghost

Description

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions