Error - No "exports" main defined
See original GitHub issueHi
I’m using: Node.js v18.0.0 Graphql-upload 16.0.2 Express 4.18.1 Only JavaScript
const { graphqlUploadExpress } = require("graphql-upload");
And show this Error:
node:internal/modules/cjs/loader:489
throw e;
^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /node_modules/graphql-upload/package.json
Command audit:
npm audit
found 0 vulnerabilities
I already executed these commands, but they do not solve anything:
# 👇️ delete node_modules and package-lock.json
rm -rf node_modules
rm -f package-lock.json
rm -f yarn.lock
# 👇️ clean npm cache
npm cache clean --force
npm install
how do I fix this error?
Thanks
Issue Analytics
- State:
- Created a year ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
No "exports" main resolved in /app/node_modules/@babel ...
With node 12.20.0, node 14.17.4, the error is not thrown. The issue is that a new system for exports has been created, as...
Read more >No "exports" main defined in package.json · Issue #4138 · ipfs ...
ipfs@0.63.x is ESM-only, which means you can't use require to load it, you have to use import . Please see the upgrade guide....
Read more >No "exports" main defined - Laracasts
Hello , After cloning my project I got the error bellow when I npm run watch (I deleted the node_modules) ERROR in ./resources/js/app.js...
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 >Modules: Packages | Node.js v19.3.0 Documentation
The "exports" provides a modern alternative to "main" allowing multiple entry points to be defined, conditional entry resolution support between environments, ...
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
Same here, been trying to upgrade to the LTS node “18.12.1” using Typescript, but this became a blocker.
@jaydenseric anything you can recommend for TS?
I’m using typescript and this mjs stuff has just made it super hard to use. I have to do stuff like allowJS which I strictly avoided before to ensure typescript was being used. Still I’m not able to get this to work