How do I install a module globally using npm

0 votes

I recently installed Node.js and npm module on OSX and have a problem with the settings I think:

npm install [MODULE] is not installing the node.js module to the default path 
which is /usr/local/lib/node_modules.
Jul 16, 2020 in Node-js by kartik
• 37,490 points
87 views

1 answer to this question.

0 votes

Hello @kartik,

I found the output contained the information I was looking for:

$> npm install -g karma
...
...
> ws@0.4.25 install /usr/local/share/npm/lib/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
...
$> ls /usr/local/share/npm/bin
karma nf

After adding /usr/local/share/npm/bin to the export PATH line in my .bash_profile, saving it, and sourceing it, I was able to run

$> karma --help

Hope it helps!!

Thank you!!

answered Jul 16, 2020 by Niroj
• 82,580 points

Related Questions In Node-js

0 votes
1 answer

How do I uninstall a package installed using npm link?

Hello @kartik, The package can be uninstalled using ...READ MORE

answered Jul 16, 2020 in Node-js by Niroj
• 82,580 points
311 views
0 votes
1 answer

How to install a private NPM module without my own registry?

Hello @kartik, In your private npm modules add "private": true to ...READ MORE

answered Jul 13, 2020 in Node-js by Niroj
• 82,580 points
358 views
0 votes
1 answer

How do I install node-sass using VSCode?

Hello @ Ebuka, Here is the following things you ...READ MORE

answered Jul 14, 2020 in Node-js by Niroj
• 82,580 points
1,734 views
0 votes
1 answer

How to install a private NPM module without my own registry?

Hello @kartik, Try: cd somedir npm install . or npm install path/to/somedir somedir must ...READ MORE

answered Jul 20, 2020 in Node-js by Niroj
• 82,580 points
96 views
0 votes
1 answer

How to download and install Lavavel framework?

Hey @kartik, First you must have xampp install ...READ MORE

answered Mar 17, 2020 in Laravel by Niroj
• 82,580 points
306 views
0 votes
1 answer

Display Laravel in browser by using cmd promt?

Hello, First you need to have laravel install ...READ MORE

answered Mar 17, 2020 in Laravel by Niroj
• 82,580 points
148 views
0 votes
1 answer

How can we get started with Laravel through Xampp?

Hii, First you need to start Apache and ...READ MORE

answered Mar 17, 2020 in Laravel by Niroj
• 82,580 points
153 views
0 votes
1 answer

How to change Laravel official name to any customize name?

Hey, You just need to go Laravel folder through ...READ MORE

answered Mar 17, 2020 in Laravel by Niroj
• 82,580 points
217 views
0 votes
1 answer

How to Install a local module using npm?

Hello @kartik, This is what worked for me: npm ...READ MORE

answered Jul 9, 2020 in Node-js by Niroj
• 82,580 points
225 views
0 votes
1 answer

How TO install a local module using npm?

Hello @kartik, In the local module directory: $ cd ...READ MORE

answered Jul 13, 2020 in Node-js by Niroj
• 82,580 points
112 views