Skip to content
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

Brand new v5 install, error on first startup - Error: Cannot find module '@strapi\plugin-content-manager\package.json' #20164

Open
jbeckton opened this issue Apr 20, 2024 · 17 comments
Assignees
Labels
issue: bug Issue reporting a bug severity: medium If it breaks the basic use of the product but can be worked around source: core:content-manager Source is core/content-manager package source: dependencies Source is dependency problem status: confirmed Confirmed by a Strapi Team member or multiple community members version: 5

Comments

@jbeckton
Copy link

Bug report

Required System information

  • Node.js version: v20.12.2
  • NPM version: 10.5.0
  • Strapi version: 5.0.0-beta.4
  • Database: Postgres
  • Operating system: Windows 11
  • Is your project Javascript or Typescript: Typescript

When I run strapi report I get the following error.

image

Describe the bug

After generating my first strapi v5 app locally using the cli command npx create-strapi-app@beta strapi choosing the custom option as well as typescript and then providing my postgres db info. When I try and run the new strapi instance for the first time using npm run develop I get missing module errors. The modules that it is complaining about are plugins such as @strapi\plugin-content-manager.

Over the course of the last hour, I have tried to re-install and run strapi v5 a few times and have seen random missing module errors. These missing modules have all been from @strapi/plugin-*

Steps to reproduce the behavior

  1. npx create-strapi-app@beta strapi
  2. cd strapi
  3. npm run develop
  4. See error

Expected behavior

I would expect strapi to start up and allow me to finish setting up the local instance.

Screenshots

image

Here is the package.json file that the cli created.

image

In previous versions of strapi I did not have to add these core plugins via npm install.

@jbeckton
Copy link
Author

jbeckton commented Apr 20, 2024

To add some context to this issue. I created two instances of strapi locally using the steps described in the initial post. Niether would start up due to missing modules. I added the missing modules to the package.json file for both instances.

    "@strapi/plugin-content-manager": "5.0.0-beta.4",
    "@strapi/plugin-email": "5.0.0-beta.4",

The first instance will now start up and allow me to complete the installation. The second instance will not. The difference in the two instances is that the one that will not run is located inside a mono-repo manage by Turborepo.

There are possibly two issues here. One is that the cli did not set up the package.json correctly for both instances, hence the missing packages.

The second issue is that even after adding the missing packages for the second instance (mono-repo) the loaders do not have the correct path when search to load these modules.

I can run strapi v4 inside a mono-repo as many times as I want but with v5 it does not seem to work. I am unable to load the strapi instance for the first time to complete the set up in the second instance (mono-repo).

@derrickmehaffy derrickmehaffy added issue: bug Issue reporting a bug severity: medium If it breaks the basic use of the product but can be worked around source: core:content-manager Source is core/content-manager package status: pending reproduction Waiting for free time to reproduce the issue, or more information version: 5 labels Apr 23, 2024
@derrickmehaffy
Copy link
Member

Can't reproduce in beta.5

@derrickmehaffy derrickmehaffy added status: can not reproduce Not enough information to reproduce and removed status: pending reproduction Waiting for free time to reproduce the issue, or more information labels Apr 24, 2024
Copy link
Contributor

This is a templated message

Hello @jbeckton,

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 .zip and upload it on this issue?

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.
Please note that issues labeled with status: can not reproduce will be closed in 14 days if there is no activity.

Thank you!

@konstantinkreft
Copy link

I guess I'm having the same issue with a fresh install of strapi@beta. But for me it is the email plugin which is missing:

Error: Cannot find module '@strapi/plugin-email/package.json'      

All I did before was npx create-strapi-app@beta strapi-5-beta --ts

Required System information:

  • Node.js version: v20.12.2
  • NPM version: 10.5.0
  • Strapi version: 5.0.0-beta.5
  • Database: SQlite
  • Operating system: macOS 14.4.1
  • Is your project Javascript or Typescript: Typescript

@jbeckton
Copy link
Author

@konstantinkreft Right, and once you add the email plugin you will then see the next missing plugin. It seems to be the core plugin modules that are the issue. I have a monorepo set up. I installed strapi 5 outside of the monorepo and then copied over the missing modules from that into the monorepo from the node_modules folder.

@jbeckton
Copy link
Author

jbeckton commented Apr 29, 2024

Can't reproduce in beta.5

@derrickmehaffy , Are you using monorepo set up for your test?

@derrickmehaffy
Copy link
Member

We dont test using monorepos that have some kind of centralized package management as we don't support them for projects. Eg we do have internal monorepos for projects but we set them up as split package management:

https://GitHub.com/Strapi/internal-lms
https://GitHub.com/Strapi/nextjs-corporate-starter

@konstantinkreft
Copy link

It is not only a problem with monorepo setups. I have no monorepo involved and still get these errors on a fresh install.

I don't have yarn installed nor do I plan to. Can this problem be related to the fact that I am using plain npm?

@jbeckton Are you also using plain npm?

@jbeckton
Copy link
Author

@konstantinkreft Yes I use NPM only.

@jbeckton
Copy link
Author

Strapi v4 worked fine within monorepo. v5 does not.

@derrickmehaffy derrickmehaffy added status: pending reproduction Waiting for free time to reproduce the issue, or more information and removed status: can not reproduce Not enough information to reproduce labels Apr 29, 2024
@derrickmehaffy derrickmehaffy added status: confirmed Confirmed by a Strapi Team member or multiple community members source: dependencies Source is dependency problem and removed status: pending reproduction Waiting for free time to reproduce the issue, or more information labels Apr 29, 2024
@gausoft
Copy link

gausoft commented Apr 30, 2024

I guess I'm having the same issue with a fresh install of strapi@beta. But for me it is the email plugin which is missing:

Error: Cannot find module '@strapi/plugin-email/package.json'      

All I did before was npx create-strapi-app@beta strapi-5-beta --ts

Required System information:

  • Node.js version: v20.12.2
  • NPM version: 10.5.0
  • Strapi version: 5.0.0-beta.5
  • Database: SQlite
  • Operating system: macOS 14.4.1
  • Is your project Javascript or Typescript: Typescript

I have the same issue

@gausoft
Copy link

gausoft commented Apr 30, 2024

After fresh install it's crashes on rollup.
cannot-find-module-rollup
When I enter npm install, I get "email plugin missing" now
cannot-find-module-strapi-plugin-email

@Sam-Flexiti
Copy link

Sam-Flexiti commented May 2, 2024

I guess I'm having the same issue with a fresh install of strapi@beta. But for me it is the email plugin which is missing:

Error: Cannot find module '@strapi/plugin-email/package.json'      

All I did before was npx create-strapi-app@beta strapi-5-beta --ts

Required System information:

  • Node.js version: v20.12.2
  • NPM version: 10.5.0
  • Strapi version: 5.0.0-beta.5
  • Database: SQlite
  • Operating system: macOS 14.4.1
  • Is your project Javascript or Typescript: Typescript

This issue still happens in beta6, it is missing this email plugin. When I tried earlier today, there is no beta6 version of the email plugin. I'm staying with beta5 for now.

You can fix this by installing the plugin manually
npm i —save @strapi/plugin-email@5.0.0-beta.5

@derrickmehaffy
Copy link
Member

We had a small issue this morning where some packages didn't get published but that should have been resolved.

@gausoft
Copy link

gausoft commented May 2, 2024

I guess I'm having the same issue with a fresh install of strapi@beta. But for me it is the email plugin which is missing:

Error: Cannot find module '@strapi/plugin-email/package.json'      

All I did before was npx create-strapi-app@beta strapi-5-beta --ts
Required System information:

  • Node.js version: v20.12.2
  • NPM version: 10.5.0
  • Strapi version: 5.0.0-beta.5
  • Database: SQlite
  • Operating system: macOS 14.4.1
  • Is your project Javascript or Typescript: Typescript

This issue still happens in beta6, it is missing this email plugin. When I tried earlier today, there is no beta6 version of the email plugin. I'm staying with beta5 for now.

You can fix this by installing the plugin manually npm i —save @strapi/plugin-email@5.0.0-beta.5

I've tried the beta.5 but having this Error: Cannot find module '@strapi/email/package.json'

@Sam-Flexiti
Copy link

I guess I'm having the same issue with a fresh install of strapi@beta. But for me it is the email plugin which is missing:

Error: Cannot find module '@strapi/plugin-email/package.json'      

All I did before was npx create-strapi-app@beta strapi-5-beta --ts
Required System information:

  • Node.js version: v20.12.2
  • NPM version: 10.5.0
  • Strapi version: 5.0.0-beta.5
  • Database: SQlite
  • Operating system: macOS 14.4.1
  • Is your project Javascript or Typescript: Typescript

This issue still happens in beta6, it is missing this email plugin. When I tried earlier today, there is no beta6 version of the email plugin. I'm staying with beta5 for now.
You can fix this by installing the plugin manually npm i —save @strapi/plugin-email@5.0.0-beta.5

I've tried the beta.5 but having this Error: Cannot find module '@strapi/email/package.json'

I think I saw this error when I mixed the versions of Strapi's beta. Since there was a delay getting beta6 of the email plug-in I set it to beta5 in the package.json. Then when I got this error I moved them all back to beta 5 to get it working. Now beta6 builds & deploys fine locally. However I find it is very buggy when using our Postgres DB as the persistence layer. I can't configure the content.

Screenshot at May 03 12-57-14
Screenshot at May 03 12-56-19

I don't understand why it says "no permissions to see this field". I'm a super admin...

@strapi-bot
Copy link

This issue has been mentioned on Strapi Community Forum. There might be relevant details there:

https://forum.strapi.io/t/announcing-the-strapi-5-beta/36987/9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug severity: medium If it breaks the basic use of the product but can be worked around source: core:content-manager Source is core/content-manager package source: dependencies Source is dependency problem status: confirmed Confirmed by a Strapi Team member or multiple community members version: 5
Projects
Status: To be reviewed
Status: To be reviewed (Open)
Status: Backlog
Status: To review
Development

No branches or pull requests

8 participants