Skip to main content
deleted 6 characters in body; edited title; edited tags
Source Link
JJJ
  • 33.2k
  • 20
  • 95
  • 103

understanding Understanding npm install -g option

Just getting started with node. I'm a little confused about the npm install -g option. Could someone tell me if the following is correct:

npm install -g installs global packages in a general location npm install installs packages in the specific folder regardless of how installed all dependencies need to be listed in the json file dependencies not installed with the -g option need to be listed as required in the appropriate *.js file 
  • npm install -g installs global packages in a general location
  • npm install installs packages in the specific folder
  • regardless of how installed all dependencies need to be listed in the json file
  • dependencies not installed with the -g option need to be listed as required in the appropriate *.js file

so for example if installed with the -g option:

var app = express(); 

and if not installed with the -g option:

var express = require(‘express’); var app = express(); 

understanding npm install -g option

Just getting started with node. I'm a little confused about the npm install -g option. Could someone tell me if the following is correct:

npm install -g installs global packages in a general location npm install installs packages in the specific folder regardless of how installed all dependencies need to be listed in the json file dependencies not installed with the -g option need to be listed as required in the appropriate *.js file 

so for example if installed with the -g option:

var app = express(); 

and if not installed with the -g option:

var express = require(‘express’); var app = express(); 

Understanding npm install -g option

Just getting started with node. I'm a little confused about the npm install -g option. Could someone tell me if the following is correct:

  • npm install -g installs global packages in a general location
  • npm install installs packages in the specific folder
  • regardless of how installed all dependencies need to be listed in the json file
  • dependencies not installed with the -g option need to be listed as required in the appropriate *.js file

so for example if installed with the -g option:

var app = express(); 

and if not installed with the -g option:

var express = require(‘express’); var app = express(); 
Source Link
DCR
  • 15.8k
  • 13
  • 61
  • 131

understanding npm install -g option

Just getting started with node. I'm a little confused about the npm install -g option. Could someone tell me if the following is correct:

npm install -g installs global packages in a general location npm install installs packages in the specific folder regardless of how installed all dependencies need to be listed in the json file dependencies not installed with the -g option need to be listed as required in the appropriate *.js file 

so for example if installed with the -g option:

var app = express(); 

and if not installed with the -g option:

var express = require(‘express’); var app = express();