0

I read npm install -g (note that no package name is specified) in a Dockerfile. What does it do?

My first guess is, it seems to install the current package (according to ./package.json in current folder) as a global package

I see the following output:

npm install -g
+ some-package-name@0.19.0
added 1 package in 0.537s

Note: Not to be confused with this question with apparently similar title: What exactly does 'npm install -g ' do? which is about install -g <package-name> with a specific package, which is not my question.

Sohail Si
  • 2,750
  • 2
  • 22
  • 36

1 Answers1

1

npm install -g will install the current package context (i.e. the current working directory) as a global package.

https://docs.npmjs.com/cli/v8/commands/npm-install

Alex
  • 848
  • 6
  • 7