Juliatzin
Juliatzin

Reputation: 19695

Installing a custom version of a package with NPM

Here is my package.json:

{
  "private": true,
  "devDependencies": {
    "axios": "^0.15.2",
    "jquery": "^3.1.0",
    "laravel-mix": "^0.8",
    "lodash": "^4.16.2",
    "phantomjs-prebuilt": "^2.1.7",
    "vue": "^2.0.1",
    "vue-resource": "^0.9.3"
  },
  "dependencies": {
    "vue-clipboard": "0.0.1",
    "vue-dragula": "^2.0.0-alpha"
  }
}

I have a plugin that is not compatible with vuejs 2.2.4, so I really need to stick with 2.0.1, but when I make a npm installit install 2.2.4.

Why isn't it respecting versioning???

Upvotes: 0

Views: 172

Answers (1)

georoot
georoot

Reputation: 3617

The problem is symbol ^ in package.json file. That will automatically install the latest version of package. Now the proper way to get around this is adding

save-exact=true

in ~/.npmrc which will automatically remove the ^ sign during install. This would prevent version change in future for installations of same package.

Upvotes: 1

Related Questions