Error [ERR_PACKAGE_PATH_NOT_EXPORTED]
See original GitHub issueI keep on getting this error since I installed this module yesterday
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /home/dev/projects/api/node_modules/jose/package.json
at throwExportsNotFound (internal/modules/esm/resolve.js:290:9)
at packageExportsResolve (internal/modules/esm/resolve.js:513:3)
at resolveExports (internal/modules/cjs/loader.js:432:36)
at Function.Module._findPath (internal/modules/cjs/loader.js:472:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:867:27)
at Module.Hook._require.Module.require (/usr/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:61:29)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/home/dev/projects/api/src/utils/utils.ts:5:14)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
Environment:
jose
version: [e.g. v3.5.1]- affected runtime is: [e.g. Node.js 14.15.4
npm
version 6.14.11
My tscongig:
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"resolveJsonModule": true,
"target": "es6",
"noImplicitAny": false,
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist",
"baseUrl": ".",
"paths": {
"*": [
"node_modules/*",
"src/types/*"
]
},
"lib": [
"es2015"
]
},
"include": [
"src/**/*"
]
}
Possibly related dependencies I use:
{"typescript": "^4.1.3",
"webpack": "^5.12.3",
"webpack-cli": "^4.3.1",
"webpack-dev-server": "^3.11.1"
},
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
No "exports" main resolved in /app/node_modules/@babel ...
node 13.14.0, node 12.18.4, 12.19.0, 12.19.1 show the error : ERR_PACKAGE_PATH_NOT_EXPORTED; With node 12.20.0, node 14.17.4, the error is ...
Read more >Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No 'exports'
Run the npm update command to solve the "Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No 'exports'" and then run npm audit fix --force if necessary.
Read more >No "exports" main defined - Laracasts
Hello , After cloning my project I got the error bellow when I npm run watch (I deleted ... Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports"...
Read more >error [err_package_path_not_exported]: package subpath
Run the npm update command to solve the "Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No 'exports'" and then run npm audit fix --force if necessary. The npm...
Read more >ERR_PACKAGE_PATH_NOT_E...
Npm #NpmErrorERR_PACKAGE_PATH_NOT_EXPORTED NPM Error FixThe error Error [ ERR_PACKAGE_PATH_NOT_EXPORTED ]: No "exports" main resolved in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I will repeat again,
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in .../node_modules/jose/package.json
means you’re doing require/import of justjose
. Please refer to each individual module’s documentation on how to require/import the respective functions.Instead of, e.g.
const { SignJWT } = require('jose/jwt/sign')
you’re probably doing something likeconst jose = require('jose')
.Follow the documentation, please 🙏 .
See v4.x and the updated module’s docs.