-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
strapi-5@0.1.0 error: Cannot find module '@strapi/email/package.json' on first start #20298
Comments
This comment has been minimized.
This comment has been minimized.
@rbjs can you run |
Hello @rbjs, Thank you for reporting this bug, however we are unable to reproduce the issue you described given the information we have on hand. Can you please create a fresh project that you are able to reproduce the issue in, provide clear steps to reproduce this issue, and either upload this fresh project to a new GitHub repo or compress it into a We would greatly appreciate your assistance with this, by working in a fresh project it will cut out any possible variables that might be unrelated. Thank you! |
Usually I don't write comments like 'same here' but I'm also seeing this and I can provide more input. Same env as OP but:
Running
The file requiring this package is here -> https://github.com/strapi/strapi/blob/v5.0.0-beta.7/packages/core/core/src/loaders/plugins/get-enabled-plugins.ts Let me know if you have additional questions |
Thanks @LuisRodriguezLD, what package manager are you using? 😊 EDIT: and node version? |
NPM 10.5.0 |
The issue comes from the fact that only @alexandrebodin || @innerdvations I think it's worth reviewing how plugins are loaded by strapi/core because whilst the immediate fix would be to add |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
I managed to reproduce it locally. From what I've found, it comes down to hoisting settings:
Note: This is something that also happen on v4 since its launch. This is still a valid issue as package managers are slowly going toward "no hoisting by default" and we're definitely going to work on it, but we've decided to lower the priority as it's not a regression and has a straightforward workaround. |
Thanks for looking into this @Convly I'm happy to work on this if you think is a good idea. |
Hey @LuisRodriguezLD ! Thanks for your input. We've talked about your proposal internally and concluded that we would rather fix the bug directly rather than add a temporary workaround for the beta. Adding more configuration for default apps for such a niche issue feels a bit too much for us. One thing that we can do though, is to add some troubleshooting into the documentation with a clear explanation of what's happening and how to solve it. We'll add the development of a fix for this issue on our current backlog and try to deliver a satisfying solution asap. What do you think? Also, to be sure, can you confirm that adding |
Understandable. Hoisting config exists in pnpm and yarn but is still a RFC in npm That being said, would you guys considering updating the severity to |
If there is a valid workaround to the issue then we leave it at low. In this case the workaround is to use that config, downgrade your npm version, or use an alternative like yarn. That's why it remains at low for now. |
On that note, while our criterion mandates us to have it as low on GitHub (for good reasons), we bumped it to medium in our internal team's backlog as we want to get it done as soon as we can |
I never encountered and still don't see this problem with v4. I only got it when trying v5 for the first time right now. This is using the Node |
As a workaround, adding |
Bug report
Required System information
Describe the bug
'npm run develop' returns fatal error on first run after fresh installation.
⠋ Loading Strapi⠋ Building build context
[INFO] Including the following ENV variables as part of the JS bundle:
- ADMIN_PATH
- STRAPI_ADMIN_BACKEND_URL
- STRAPI_TELEMETRY_DISABLED
✔ Building build context (47ms)
✔ Creating admin (378ms)
[ERROR] There seems to be an unexpected error, try again with --debug for more information
`
│ Error: Cannot find module '@strapi/email/package.json'
│ Require stack:
│ - /Users/dev/strapi5/node_modules/@strapi/core/dist/loaders/plugins/get-enabled-plugins.js
│ - /Users/dev/strapi5/node_modules/@strapi/core/dist/loaders/plugins/index.js
│ - /Users/dev/strapi5/node_modules/@strapi/core/dist/loaders/index.js
│ - /Users/dev/strapi5/node_modules/@strapi/core/dist/providers/registries.js
│ - /Users/dev/strapi5/node_modules/@strapi/core/dist/providers/index.js
│ - /Users/dev/strapi5/node_modules/@strapi/core/dist/Strapi.js
│ - /Users/dev/strapi5/node_modules/@strapi/core/dist/index.js
│ - /Users/dev/strapi5/node_modules/@strapi/strapi/dist/cli/commands/admin/create-user.js
│ - /Users/dev/strapi5/node_modules/@strapi/strapi/dist/cli/commands/index.js
│ - /Users/dev/strapi5/node_modules/@strapi/strapi/dist/cli/index.js
│ - /Users/dev/strapi5/node_modules/@strapi/strapi/bin/strapi.js
│ at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
│ at Module._load (node:internal/modules/cjs/loader:984:27)
│ at Module.require (node:internal/modules/cjs/loader:1231:19)
│ at require (node:internal/modules/helpers:179:18)
│ at Module.getEnabledPlugins (/Users/dev/strapi5/node_modules/@strapi/core/dist/loaders/plugins/get-enabled-plugins.js:55:25)
│ at loadPlugins (/Users/dev/strapi5/node_modules/@strapi/core/dist/loaders/plugins/index.js:76:50)
│ at Module.loadApplicationContext (/Users/dev/strapi5/node_modules/@strapi/core/dist/loaders/index.js:16:5)
│ at Object.register (/Users/dev/strapi5/node_modules/@strapi/core/dist/providers/registries.js:26:17)
│ at Strapi.register (/Users/dev/strapi5/node_modules/@strapi/core/dist/Strapi.js:301:32)
│ at Strapi.load (/Users/dev/strapi5/node_modules/@strapi/core/dist/Strapi.js:293:16)
`
Steps to reproduce the behavior
npx create-strapi-app@beta my-project --quickstart
cd my-project
npm run develop
The text was updated successfully, but these errors were encountered: