Linux环境安装Strapi时出现@strapi/typescript-utils文件找不到错误
解决Strapi安装依赖失败及TS6053配置文件找不到问题
一、定位依赖安装失败的具体原因
由于初始安装无详细日志,先强制清理缓存并重新安装,同时启用调试日志:
- 删除现有项目目录:
rm -rf my-project - 清理npx缓存并带调试参数重新创建项目:
此时能看到依赖安装的完整日志,可根据日志定位具体失败点(如网络问题、权限问题或包版本冲突)。npx --clear-cache create-strapi-app@latest my-project --debug
二、修复TS6053找不到配置文件的错误
该错误源于tsconfig.json引用的@strapi/typescript-utils/tsconfigs/server文件不存在,通常是依赖未安装完全或缓存异常导致,可按以下步骤解决:
方案1:清理Yarn缓存并重装依赖
- 进入项目目录:
cd my-project - 清理Yarn缓存:
yarn cache clean - 删除现有依赖目录和锁文件:
rm -rf node_modules yarn.lock - 重新安装依赖并启动:
yarn install && yarn develop
方案2:匹配兼容的Strapi或Node.js版本
- Node.js v18.4为非LTS版本,可能与最新版Strapi存在兼容性问题。可尝试指定之前成功安装过的Strapi 4.x版本创建项目:
npx create-strapi-app@4.10.0 my-project - 或升级Node.js至LTS版本(如v18.17+、v20.x),避免非LTS版本的已知问题。
方案3:临时修复tsconfig.json配置
若上述方法无效,可临时修改tsconfig.json,替换缺失的extends配置:
{ "compilerOptions": { "target": "ES2020", "module": "commonjs", "lib": ["ES2020"], "rootDir": "./", "outDir": "./dist", "strict": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true }, "include": ["src/**/*"], "exclude": ["node_modules", "dist"] }
修改后执行yarn develop即可启动,但此为临时方案,建议优先解决依赖安装问题。
额外排查点
- 检查网络连通性,若访问官方镜像缓慢,可切换国内Yarn镜像:
yarn config set registry https://registry.npmmirror.com/ - 确认当前用户对项目目录拥有读写权限,避免权限不足导致依赖安装失败。
内容的提问来源于stack exchange,提问作者sauravscode
相关产品推荐
相关产品推荐

