Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is node_modules directory?

If I create a new AWS instance (ubuntu 16.04 LTS) and create a directory (NodeT) then run the 2 commands:

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

( from https://nodejs.org/en/download/package-manager/ )

I then have successfully installed node and npm?

node -v
npm -v

return their versions.

So have I created it locally on NodeT or globally on the whole system? Where is the node_modules directory?

I am trying to install mongodb on the system and am having troubles. I believe I need to run:

nodejs node_modules/node-sass/scripts/install.js
npm rebuild node-sass

( from https://github.com/sass/node-sass/issues/1579 ) to solve my problems, but the command can't find the node_modules directory and either can I.

I'm clearly missing the basic concept of nodejs. Any help would be appreciated.

like image 605
dennis Avatar asked Sep 01 '25 05:09

dennis


1 Answers

type this command in your terminal

sudo npm root -g

Output (example):

/usr/local/lib/node_modules
like image 171
Joel Jaime Avatar answered Sep 02 '25 18:09

Joel Jaime