# How to get your packages right (for example, upgrading from 3.0 to 4.0)

**URL:** <https://forums.bitovi.com/t/how-to-get-your-packages-right-for-example-upgrading-from-3-0-to-4-0/1013>\
**Category:** CanJS\
**Created:** [January 9, 2019, 8:36pm UTC](https://forums.bitovi.com/t/how-to-get-your-packages-right-for-example-upgrading-from-3-0-to-4-0/1013 "2019-01-09T20:36:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)\
**Post date:** [January 9, 2019, 8:36pm UTC](https://forums.bitovi.com/t/how-to-get-your-packages-right-for-example-upgrading-from-3-0-to-4-0/1013/1 "2019-01-09T20:36:20Z")

</div>

Asked here in slack: [https://gitter.im/canjs/canjs?at=5c36397357c6883f9b8af85a](https://gitter.im/canjs/canjs?at=5c36397357c6883f9b8af85a), the question is

> Is there a way to simultaneously upgrade all npm libraries to a compatible version when moving to can4 from can3 ?

Unfortunately, there’s not an easy way of doing this. We’ve actually been talking about creating something to do this. For example: [https://twitter.com/justinbmeyer/status/1080513028985110528](https://twitter.com/justinbmeyer/status/1080513028985110528)

So the process is currently a manual one. The place to start is to look at the `dependencies` of the package.json of the release you want to upgrade to. For example, here is 4.3.0:

> <https://github.com/canjs/canjs/blob/v4.3.0/package.json#L43>

Most likely, you don’t need all of those packages. You can probably start with the ones you need:

```js
"can-component": "4.2.2",
"can-define": "2.4.0",
"can-debug": "1.3.0",
"can-route": "4.3.0",
"can-stache": "4.9.0",
"can-stache-route-helpers": "1.1.0",

```

Once that is done, I suggest adding `^` to get the latest `4.0` compatible versions of everything:

```auto
"can-component": "^4.2.2",
"can-define": "^2.4.0",
"can-debug": "^1.3.0",
"can-route": "^4.3.0",
"can-stache": "^4.9.0",
"can-stache-route-helpers": "^1.1.0",

```

**IMPORTANT!!!** `package-lock.json` is your enemy while doing this. Make sure to delete it (and keep deleting it) or add a `.npmrc` file with:

```auto
package-lock=false

```

Example: [https://github.com/canjs/can-component/blob/master/.npmrc](https://github.com/canjs/can-component/blob/master/.npmrc)

Once your app works again, it’s fine to bring back a `package-lock.json`. But anytime you change your packages, you should always:

1. delete the package-lock
2. delete `node_modules`
3. update your package.json
4. `npm install`
