Giter Site home page Giter Site logo

Comments (13)

inxilpro avatar inxilpro commented on July 29, 2024

Hmm, this is an interesting issue. Arguably, it should return /home/<username>/.nvm/v0.10.36/lib/node_modules/exampleCLI/ without the bin/ component. The reason you're not getting /home/<username>/.nvm/v0.10.36/lib/ is because you're dealing with a node global path.

Interesting. Let me give it a bit of thought. This is another example of how many freaking edge cases there are where it's hard to say what the "root path" actually is :)

from node-app-root-path.

zero5100 avatar zero5100 commented on July 29, 2024

I am currently experiencing this issue as well. I created and installed a global npm module that has a cli command, and app-root-path reports the /bin directory as the path.

from node-app-root-path.

inxilpro avatar inxilpro commented on July 29, 2024

Hrm, seems like maybe there needs to be custom logic for bin/ (and /.bin perhaps). It seems like unless your module is called "bin" it should be fine, and this is common npm functionality…

from node-app-root-path.

zero5100 avatar zero5100 commented on July 29, 2024

Yeah...if you are naming your project "bin" you are just asking for things to break.

from node-app-root-path.

inxilpro avatar inxilpro commented on July 29, 2024

@zero5100 are you using nvm as well?

from node-app-root-path.

zero5100 avatar zero5100 commented on July 29, 2024

@inxilpro Yes, I am.

from node-app-root-path.

inxilpro avatar inxilpro commented on July 29, 2024

The latest commits should fix this. Sorry it took so long. You can try it with:

npm i -S app-root-path@beta

I'll publish as 1.1.0 shortly after a little more testing.

from node-app-root-path.

olsonpm avatar olsonpm commented on July 29, 2024

Not a problem - and thanks much!

from node-app-root-path.

inxilpro avatar inxilpro commented on July 29, 2024

Would you mind confirming that the fix works as expected?

from node-app-root-path.

olsonpm avatar olsonpm commented on July 29, 2024

I'm busy tonight but will get to it tomorrow.

from node-app-root-path.

inxilpro avatar inxilpro commented on July 29, 2024

Of course! Whenever you have time…

from node-app-root-path.

olsonpm avatar olsonpm commented on July 29, 2024

Got around to it just now - works as expected.

woot

from node-app-root-path.

rockymadden avatar rockymadden commented on July 29, 2024

Experiencing this same issue but with src where the project is a CLI whose index lives at ./src/index.js.

from node-app-root-path.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.