我正试图在我的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)
如能就此问题提供任何帮助,我将不胜感激。
2条答案
按热度按时间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.json
和yarn.lock
1.运行
npm install
或/和yarn install
xn1cxnb42#
我也在Strapi论坛上发布了这个问题,结果发现问题出在Strapi 4.3.5。他们建议更新到4.3.6,因为此问题已热修复。我可以确认,在Strapi 4.3.6上不再存在此问题。