Cannot find package
Closed this issue · 3 comments
deguich commented
Using with node V14.12.0 and
{ "type": "module" }
in package.json
A simple main.js conaining one line :
import jwksClient from "jwt-jwks-client";
produce this error :
Cannot find package '...\node_modules\jwt-jwks-client\'
It's probably besause the main attribute in package.json should be :
"main": "lib/index.js",
After update main attribute. I can use your module like this :
import JwtJwksClientPkg from "jwt-jwks-client";
const { default: JwksClient } = JwtJwksClientPkg;
const client = new JwksClient({
secure: true, // Default value
jwksUri: 'https://my-host/.well-known/jwks.json',
rateLimit: 0, // Optional, num of request per min, 0 means no limit
requestHeaders: {}, // Optional
requestAgentOptions: {}, // Optional
timeout: 30000, // Optional, default 30s
});
...
WangHansen commented
Thanks for catching this! Pushed a new patch for the fix!
deguich commented
Thx, could you publish this new version ?
WangHansen commented
Thx, could you publish this new version ?
My bad, I thought I had. Now it should be updated!