# Having a bit of a hard time to upgrade the project from V? to V7

**URL:** <https://community.forestadmin.com/t/having-a-bit-of-a-hard-time-to-upgrade-the-project-from-v-to-v7/2508>\
**Category:** Help me!\
**Tags:** howtos\
**Created:** [May 17, 2021, 10:06pm UTC](https://community.forestadmin.com/t/having-a-bit-of-a-hard-time-to-upgrade-the-project-from-v-to-v7/2508 "2021-05-17T22:06:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emixam23](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/emixam23/32/1350_2.png) [@Emixam23](https://community.forestadmin.com/u/Emixam23)\
**Post date:** [May 17, 2021, 10:06pm UTC](https://community.forestadmin.com/t/having-a-bit-of-a-hard-time-to-upgrade-the-project-from-v-to-v7/2508/1 "2021-05-17T22:06:28Z")

</div>

Hello there!

As I am getting this yellow top banner telling my project will soon (june 30th) stop working (depreciated), I got into the upgrade of it 🙂

As stated in a previous post, I translated a part of my project into Typescript and everything was working well. However, updating my work to v7 has been a tough job and so, I decided to update Lumber (I had a version from 2019 installed on my machine) to the latest release and create a fresh new project (in order to generate brand new sources)

I started to import all my code. Of course I had to rewrite some (mostly models approach) but otherwise, it was mostly overriding existing code (app.js, server.js, middlewares/\*, etc)

## Expected behavior

When I start my program, i would like it to work xD

## Actual behavior

I am getting something quite weird which seems to be related to jwt

```javascript
----------------------
[11:57:03 PM] Starting compilation in watch mode...

[11:57:22 PM] Found 0 errors. Watching for file changes.

[nodemon] 2.0.7
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): dist\**\*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node ./dist/server.js`
C:\.........\project\node_modules\express-jwt\lib\index.js:22
  if (!options.algorithms) throw new Error('algorithms should be set');
                           ^

Error: algorithms should be set
    at module.exports (C:\.........\project\node_modules\express-jwt\lib\index.js:22:34)
    at Object.<anonymous> (C:\.........\project\dist\app.js:31:9)

```

## Context

Please provide any relevant information about your setup.

```javascript
"dependencies": {
  "@types/express": "^4.17.11",
  "@types/forest-express-mongoose": "^7.5.0",
  "@types/mongoose": "^5.10.5",
  "axios": "^0.21.1",
  "body-parser": "1.19.0",
  "chalk": "~4.1.1",
  "cookie-parser": "1.4.5",
  "cors": "2.8.5",
  "debug": "~4.3.1",
  "dotenv": "~9.0.2",
  "express": "~4.17.1",
  "express-jwt": "6.0.0",
  "forest-express-mongoose": "^7.6.0",
  "mongoose": "~5.12.9",
  "morgan": "1.10.0",
  "nodemon": "^2.0.7",
  "require-all": "^3.0.0",
  "tsc-watch": "^4.2.9",
  "typescript": "^4.2.4"
}

```

* * *

Maybe it’s all about giving an algorithm parameter to jwt at initialisation but I don’t even know which one to put so..

Let me know if you need more info 🙂

Thanks!

Best,

Max

---

<div class="post-metadata">

**Author:** ![GuillaumeGautreau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaumegautreau/32/557_2.png) [@GuillaumeGautreau](https://community.forestadmin.com/u/GuillaumeGautreau)\
**Post date:** [May 18, 2021, 7:20am UTC](https://community.forestadmin.com/t/having-a-bit-of-a-hard-time-to-upgrade-the-project-from-v-to-v7/2508/2 "2021-05-18T07:20:08Z")

</div>

Hello @Emixam23,

It seems that you also updated the dependency `express-jwt` in the process. I just generate a new project with lumber locally to check, and the version that is generated is `"express-jwt": "5.3.1"`, but your `package.json` file shows that you are requiring `"express-jwt": "6.0.0"`.

This new version requires you to specify an algorithm for the JWT, as stated [in their docs](https://github.com/auth0/express-jwt#required-parameters).

In your case, you can add `algorithms: ['HS256']` in the file `app.json`:

```javascript
app.use(jwt({
  secret: process.env.FOREST_AUTH_SECRET,
  credentialsRequired: false,
  algorithms: ['HS256']
}));

```

Or downgrade `express-jwt` to the latest v5

---

<div class="post-metadata">

**Author:** ![Emixam23](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/emixam23/32/1350_2.png) [@Emixam23](https://community.forestadmin.com/u/Emixam23)\
**Post date:** [May 19, 2021, 9:17pm UTC](https://community.forestadmin.com/t/having-a-bit-of-a-hard-time-to-upgrade-the-project-from-v-to-v7/2508/3 "2021-05-19T21:17:11Z")

</div>

Thanks 🙂

I could mostly move forward, I recreated a side project and then adapt mine to it 🙂

I still have some issue but I guess it’s more related to mongoose/typescript, so I am gonna open a new issue as it’s related to one part of your documentation which might be a bit obsolete 🙂

New issue at: [Upgrading to v7, MongoDB/Typescript documentation might be a bit obsolete](https://community.forestadmin.com/t/upgrading-to-v7-mongodb-typescript-documentation-might-be-a-bit-obsolete/2529)

Thanks for your help!

Best,

Max
