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

Do modules need to be installed globally? #1869

Closed
code4cake opened this issue Sep 4, 2016 · 12 comments
Closed

Do modules need to be installed globally? #1869

code4cake opened this issue Sep 4, 2016 · 12 comments

Comments

@code4cake
Copy link

  • node version: <run "node -v" in you terminal and replace this> 4.4.7
  • npm version: <run "npm -v" in you terminal and replace this> 2.15.8

So I would like to run the modules from within a folder I created. I did npm install javascripting & npm install learnyounode the both installed, but I'm unable to run the modules within this folder. Globally I have no problems.

Is there a way around this?

Thanks

@hackergrrl
Copy link

Is there an error? What happens when, after installing locally, you run

$ node_modules/javascripting/bin/javascripting

@code4cake
Copy link
Author

@noffle, thank you. I was still trying to run it by just calling javascripting
Your solution worked. Thanks.

Question to just run it with javascripting instead of node_modules/javascripting/bin/javascripting I would have to make that executable available in my path? Is this correct?

Thanks

@hackergrrl
Copy link

Yes, that's correct. Something like export PATH=$PATH:/somepath/node_modules/javascripting/bin.

However, if your qualm with global installs is that it requires superuser privileges, you can tell npm to use e.g. your home directory for global installs:

$ npm set prefix $HOME/.npm-global

Now all npm -g installs you do will be placed here. This has the nice side effect of letting you set just one directory in your PATH to capture all globally installed executables:

export PATH=$PATH:$HOME/.npm-global/bin

@code4cake
Copy link
Author

@noffle right now I have a .npm/ directory on my home. But I think that's the same thing?. Anyways thanks for the help and for the info. Should I close this issue?

@martinheidegger
Copy link
Contributor

@dantesolis @noffle I feel like this should be noted somewhere on the homepage. I am busy with other things, but perhaps one of you could help everyone out and add a paragraph at a good place?

@code4cake
Copy link
Author

@martinheidegger & @noffle I could do it. I Just read the contribution section and about to clone the repo on my machine. Waiting for the greenlight

@SomeoneWeird
Copy link
Member

Go ahead. Make a PR and somebody can review it 👍

@riyadhalnur
Copy link
Member

riyadhalnur commented Sep 6, 2016

@dantesolis Yes, please go ahead. Tag one of us once you open the PR. Thank you in advance 😃

@code4cake
Copy link
Author

No problems. Thanks guys.

@martinheidegger
Copy link
Contributor

@dantesolis was so kind to add a section to the readme of nodeschool.github.io.

@martinheidegger
Copy link
Contributor

@dantesolis can this issue be closed?

@code4cake
Copy link
Author

@martinheidegger, yes, I'll go ahead and close it. And thanks guys for letting me contribute. Now to start working on those modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants