How can I install a Node.js module under $HOME/bin

paulodiovani

The question title is self-expanatory, but just to make more clear...

With npm install -g I can install anything globaly, what turns it in an application command. But, in GNU/Linux, this requires root access, so, what if I want install something as a command, but only for the current logged user, and not needing root access?

Is that possible?

paulodiovani

After @brian-glaz tip I managed to do like this:

Create a ~/.npmrc file with the folowing content

prefix=~/

Notice that it must be lowercase prefix.

You can check the paths as follows:

paulo.goncalves@paulogoncalves:~$ npm -g root
/home/paulo.goncalves/lib/node_modules
paulo.goncalves@paulogoncalves:~$ npm -g bin
/home/paulo.goncalves/bin

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I install node.js?

From Dev

How can I update the protractor npm module in node.js?

From Dev

How can I install node.js without putting it in the path?

From Dev

How can I install gdbm module on heroku?

From Dev

How can I use browserify module for adapting xml2js node module for the browser?

From Dev

How can I install the development version of Node?

From Dev

How can I install the development version of Node?

From Dev

How to install customer node.js binary module globally?

From Dev

How can I use the Node.js 'async' module to do 'A' or 'B' and then always 'C' in one function?

From Dev

Node module giving no output - have I misunderstood how to install it?

From Dev

How can I update node.js and install grunt/bower in a python project in Travis CI?

From Dev

Can I use brew to install Node.js?

From Dev

Can I install Node.js on Endless OS efficiently?

From Dev

How can I install Pythons MySQLdb module on openSUSE?

From Dev

How can I install the module gateways and find the adress of my routeur

From Dev

How can I idempotently pecl install a module twice?

From Dev

Node.js/MongoDB: How can I use module.exports to pass a localhost database url to server.js file?

From Dev

Can't get Sass module to install for gulp.js using node.js

From Dev

How can I make node js synchronize?

From Java

How can I import node module into svelte component

From Dev

How do I reference a js file from a node module in HTML?

From Dev

Ionic 2.0.0-beta.24 how can i import node_module css files without ionic.config.js

From Dev

How can I return ordered data from Firebase database with Node.js using the firebase-admin module?

From Dev

How can I install jsawk to node and run with shelljs on Windows?

From Dev

how can i install all node modules in different folders?

From Dev

How do I install the latest version of node.js?

From Dev

Node.js+npm, should I use global or local module install?

From Dev

In node.js how do I access a function from app.js that is in a module that is in another module?

From Dev

How can I delete ldap node and delete all the subtree node under it using Java?

Related Related

  1. 1

    How can I install node.js?

  2. 2

    How can I update the protractor npm module in node.js?

  3. 3

    How can I install node.js without putting it in the path?

  4. 4

    How can I install gdbm module on heroku?

  5. 5

    How can I use browserify module for adapting xml2js node module for the browser?

  6. 6

    How can I install the development version of Node?

  7. 7

    How can I install the development version of Node?

  8. 8

    How to install customer node.js binary module globally?

  9. 9

    How can I use the Node.js 'async' module to do 'A' or 'B' and then always 'C' in one function?

  10. 10

    Node module giving no output - have I misunderstood how to install it?

  11. 11

    How can I update node.js and install grunt/bower in a python project in Travis CI?

  12. 12

    Can I use brew to install Node.js?

  13. 13

    Can I install Node.js on Endless OS efficiently?

  14. 14

    How can I install Pythons MySQLdb module on openSUSE?

  15. 15

    How can I install the module gateways and find the adress of my routeur

  16. 16

    How can I idempotently pecl install a module twice?

  17. 17

    Node.js/MongoDB: How can I use module.exports to pass a localhost database url to server.js file?

  18. 18

    Can't get Sass module to install for gulp.js using node.js

  19. 19

    How can I make node js synchronize?

  20. 20

    How can I import node module into svelte component

  21. 21

    How do I reference a js file from a node module in HTML?

  22. 22

    Ionic 2.0.0-beta.24 how can i import node_module css files without ionic.config.js

  23. 23

    How can I return ordered data from Firebase database with Node.js using the firebase-admin module?

  24. 24

    How can I install jsawk to node and run with shelljs on Windows?

  25. 25

    how can i install all node modules in different folders?

  26. 26

    How do I install the latest version of node.js?

  27. 27

    Node.js+npm, should I use global or local module install?

  28. 28

    In node.js how do I access a function from app.js that is in a module that is in another module?

  29. 29

    How can I delete ldap node and delete all the subtree node under it using Java?

HotTag

Archive