Npm 重新启动服务器后出现Strapi错误-“;错误:找不到模块';strapi utils'&引用;
我在尝试使用content builder的strapi后端遇到问题,因此退出服务器并重新启动,出现以下错误:Npm 重新启动服务器后出现Strapi错误-“;错误:找不到模块';strapi utils'&引用;,npm,strapi,Npm,Strapi,我在尝试使用content builder的strapi后端遇到问题,因此退出服务器并重新启动,出现以下错误: Error: Cannot find module 'strapi-utils' Require stack: - /usr/local/lib/node_modules/strapi/bin/strapi.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15) at
Error: Cannot find module 'strapi-utils'
Require stack:
- /usr/local/lib/node_modules/strapi/bin/strapi.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
at Function.Module._load (internal/modules/cjs/loader.js:690:27)
at Module.require (internal/modules/cjs/loader.js:852:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/usr/local/lib/node_modules/strapi/bin/strapi.js:13:17)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/usr/local/lib/node_modules/strapi/bin/strapi.js' ]
错误:找不到模块'strapi utils'
需要堆栈:
-/usr/local/lib/node_modules/strapi/bin/strapi.js
在Function.Module.\u解析文件名(internal/modules/cjs/loader.js:797:15)
at Function.Module._load(内部/modules/cjs/loader.js:690:27)
at Module.require(内部/modules/cjs/loader.js:852:19)
根据需要(internal/modules/cjs/helpers.js:74:18)
反对。(/usr/local/lib/node_modules/strapi/bin/strapi.js:13:17)
at模块编译(内部/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js(internal/modules/cjs/loader.js:995:10)
在Module.load(内部/modules/cjs/loader.js:815:32)
at Function.Module._load(内部/modules/cjs/loader.js:727:14)
位于Function.Module.runMain(internal/modules/cjs/loader.js:1047:10){
代码:“未找到模块”,
requireStack:['/usr/local/lib/node_modules/strapi/bin/strapi.js']
我已尝试重新安装strapi utils(npm I strapi utils),但仍然抛出错误。我还可以尝试什么。在此之前,我一直工作得很好。只是现在不想重新启动
提前感谢,,
Tom我可以通过Strapi Deliveroo示例来确认这个问题
artin add strap utils
解决了这个问题。这是一个JSON包,其中包括我为使新版本平台的所有模块正常工作而必须添加的附加包和其他包。该示例还存在其他问题,因此其中一些包可能没有直接关系
{
"dependencies":
{
"@apollo/react-hooks": "^3.1.5",
"@apollo/react-ssr": "^3.1.5",
"apollo-boost": "^0.4.9",
"apollo-client": "^2.6.10",
"bootstrap": "^4.5.0",
"gql": "^1.1.2",
"graphql": "^15.0.0",
"next": "^9.4.0",
"next-apollo": "^4.0.1",
"react": "^16.13.1",
"react-apollo": "^3.1.5",
"react-dom": "^16.13.1",
"reactstrap": "^8.4.1",
"recompose": "^0.30.0",
"strapi-utils": "^3.0.0-beta.20.3"
},
"scripts":
{
"dev": "next",
"build": "next build",
"start": "next start"
}
}
您好,能否请您精确说明您正在使用的Strapi版本。以及您为解决此问题所做的步骤。如果没有更多信息,将很难提供帮助。您的package.json是什么样子的?通常情况下,Strapi安装程序应该安装了所有必要的utils:)