0

I have a package.json with both

"dependencies": {
  "d3": "~3.5.5",
  "forever": "^0.14.1"
},
"scripts": {
   "install":   "make -f install.makefile"
   "data":  "make -f data.makefile core",
   "serve": "node ./node_modules/.bin/forever ./node_modules/.bin/http-server"

}

When I check my scripts by running npm run, I get :

enter image description here

I wonder if "install" is a reserved keywords, since it is not grouped with other scripts.

Is install a reserved word with special behavior when in packages.json's scripts object ?

Hugolpz
  • 17,296
  • 26
  • 100
  • 187

2 Answers2

2

From the docs: https://docs.npmjs.com/misc/scripts

install, postinstall: Run AFTER the package is installed.

SteamDev
  • 4,294
  • 5
  • 20
  • 29
  • Thanks, this is important. So I don't need to do `npm install` + `npm run install`, right ? – Hugolpz Feb 10 '16 at 23:29
  • `npm install` will actually run both `npm install` AND THEN `npm run install`, correct ? – Hugolpz Feb 10 '16 at 23:37
  • 1
    That is correct. It will preform the standard package installation, and then the user defined "install" script afterwards. – SteamDev Feb 11 '16 at 01:12
1

It isn't reserved, rather it's one of npm's built-in commands.

Meaning rather then npm run install, you'd execute npm install.