sqlite Strapi:中间件“stRapi::Body”:无法解析‘strapi.plugin(...)’的属性‘config’因为它是未定义的

czq61nw1  于 2022-11-15  发布在  SQLite
关注(0)|答案(2)|浏览(156)

我正试图在我的Mac上安装一个全新的Strapi应用程序,方法是运行

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

司令。它可以很好地安装Strapi应用程序,但当我尝试运行“npm run Development”时,我收到以下错误:
“Strapi:MIDDLEWARE”stRapi::Body“:无法拆分‘strapi.plugin(...)’的属性‘config’,因为它未定义。”
而且这款应用程序也无法启动。完整的错误文本如下:

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)

如能就此问题提供任何帮助,我将不胜感激。

f87krz0w

f87krz0w1#

yarn develop时得到相同的异常。
1.确保您有正确的node版本范围
node -v如果不使用nvm use 14.19.1(或以上)
1.转到package.json,更改stRapi版本。
"@strapi/strapi": "^4.3.5""@strapi/strapi": "^4.3.6"
1.移除package-lock.jsonyarn.lock
1.运行npm install或/和yarn install

xn1cxnb4

xn1cxnb42#

我也在Strapi论坛上发布了这个问题,结果发现问题出在Strapi 4.3.5。他们建议更新到4.3.6,因为此问题已热修复。我可以确认,在Strapi 4.3.6上不再存在此问题。

相关问题