[Solved] express-jwt Error: Error: algorithms should be set

When using express JWT, the following errors are reported during compilation:

as a result of:

After JWT is updated on July 7, 2020, the installed express JWT module will default to version 6.0.0. The updated JWT needs to add the algorithms attribute to the configuration, that is, set the algorithm of JWT. Generally, hs256 is the default value for configuring algorithms:

Read More: