Giter Club home page Giter Club logo

Comments (5)

nevir avatar nevir commented on May 10, 2024

Sneaking an export NODE_PATH="$NVM_DIR/$VERSION/lib/node_modules" at the bottom of use seems to do the trick (on v0.4.11 at least), though I'm not sure if it's the right thing to do? (At the very least, it probably needs to preserve the user's current value of $NODE_PATH, I'd think)

from nvm.

ProjectMoon avatar ProjectMoon commented on May 10, 2024

The behavior of NPM changed drastically when the node_modules functionality went in. Global installation is generally for stuff that has commands. If you want to use a module programmatically, do not do a global installation.

See https://github.com/isaacs/npm/blob/master/doc/faq.md#readme. Start at "How do I install something everywhere?"

Also see http://nodejs.org/docs/v0.5.4/api/modules.html#loading_from_node_modules_Folders

from nvm.

nevir avatar nevir commented on May 10, 2024

Ah hm, thanks for the tips! I'll go bug some npm folk, then - I went down that rabbit hole due to npm link sticking my in-dev package into a global node_modules :-/

Closing

from nvm.

ProjectMoon avatar ProjectMoon commented on May 10, 2024

Are you using a really old version of NPM? The version should be 1.something I think. It should not be 0.x.

Edit: Doesn't look like you are... npm link should work just fine. Go to a directory and then link whatever you want into it. It will link it to the global folder and then to your current directory. That's what the FAQ means when it says "check out npm link" I think.

from nvm.

nevir avatar nevir commented on May 10, 2024

I think this may be a special case - I effectively want a self-referential link to the current project

npm link; npm link project-name did the trick! (Though, it seems a bit awkward)

from nvm.

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.