简体   繁体   中英

Strapi: Middleware "strapi::body": Cannot destructure property 'config' of 'strapi.plugin(...)' as it is undefined

I am trying to install a fresh Strapi app on my mac, by running the

npx create-strapi-app@latest my-project --quickstart

commnand. It installs the Strapi app fine, but when I try to run "npm run develop", I get this error:

"Strapi: Middleware "strapi::body": Cannot destructure property 'config' of 'strapi.plugin(...)' as it is undefined."

And the app doesn't start. full error text is as follows:

 Middleware "strapi::body": Cannot destructure property 'config' of 'strapi.plugin(...)' as it is undefined.
Error: Middleware "strapi::body": Cannot destructure property 'config' of 'strapi.plugin(...)' as it is undefined.
    at instantiateMiddleware (/Users/davit/Github/my-project/node_modules/@strapi/strapi/lib/services/server/middleware.js:12:11)
    at resolveMiddlewares (/Users/davit/Github/my-project/node_modules/@strapi/strapi/lib/services/server/middleware.js:56:18)
    at registerApplicationMiddlewares (/Users/davit/Github/my-project/node_modules/@strapi/strapi/lib/services/server/register-middlewares.js:66:29)
    at async Object.initMiddlewares (/Users/davit/Github/my-project/node_modules/@strapi/strapi/lib/services/server/index.js:99:7)
    at async Strapi.bootstrap (/Users/davit/Github/my-project/node_modules/@strapi/strapi/lib/Strapi.js:445:5)
    at async Strapi.load (/Users/davit/Github/my-project/node_modules/@strapi/strapi/lib/Strapi.js:457:5)
    at async Strapi.start (/Users/davit/Github/my-project/node_modules/@strapi/strapi/lib/Strapi.js:198:9) 

Would appreciate any help regarding this issue.

Got the same exception when yarn develop .

  1. Make sure you have right version range for node

    node -v if not use nvm use 14.19.1 (or above)

  2. Go to package.json and change strapi version.

    from "@strapi/strapi": "^4.3.5" to "@strapi/strapi": "^4.3.6"

  3. Remove package-lock.json and yarn.lock

  4. Run npm install or/and yarn install

I had also posted this question in Strapi forums and it turns out that the problem was with Strapi 4.3.5. They advised updating to 4.3.6 as this issue had been hotfixed. I can confirm that this issue no longer exists on Strapi 4.3.6.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM