npm installing old version for ^0.x.x packages


(Alec Larson) #1

What I Wanted to Do

A dependency on ^0.0.x should install the highest version below 0.1.0

What Happened Instead

For example, if I depend on ^0.0.1 and 0.0.2 is published, 0.0.1 is still installed

Reproduction Steps

  • Add "lodge": "^0.0.4" to your package.json
  • Run npm install
  • Check cat node_modules/lodge/package.json | grep version

Platform Info

$ npm --versions
{ npm: '5.6.0',
  ares: '1.13.0',
  cldr: '33.0',
  http_parser: '2.8.0',
  icu: '61.1',
  modules: '59',
  napi: '3',
  nghttp2: '1.32.0',
  node: '9.11.2',
  openssl: '1.0.2o',
  tz: '2018c',
  unicode: '10.0',
  uv: '1.19.2',
  v8: '6.2.414.46-node.23',
  zlib: '1.2.11' }
$ node -p process.platform
darwin

(Alec Larson) #2

Oh, whoops. I just remembered that 0.0.x acts differently than 0.1.x

Sorry!


(system) #3

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.