0

This is my package.json:

{
  "name": "pr",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "typescript": "^2.0.3"
  }
}

When I run npm install, I get version 2.0.8

⇒  npm install
pr@1.0.0 /Users/shlomitc/WebstormProjects/pr
└── typescript@2.0.8

When I run npm update I get version 2.1.1!

⇒  npm update
pr@1.0.0 /Users/shlomitc/WebstormProjects/pr
└── typescript@2.1.1

Why npm install and update behaves differently?

ShlomiTC
  • 446
  • 4
  • 12

1 Answers1

0

According to npm guys, this is the correct behavior, it's just not described well enough in the docs.

npm install installs the latest tagged version, currently 2.0.8

npm update installs the highest possible version, currently 2.1.1

https://github.com/npm/npm/issues/14586

ShlomiTC
  • 446
  • 4
  • 12