File '@strapi/typescript-utils/tsconfigs/server' not found. Error on installing strapi in linux
Asked Answered
S

6

7

tsconfig.json:2:14 - error TS6053: File '@strapi/typescript-utils/tsconfigs/server' not found.

2 "extends": "@strapi/typescript-utils/tsconfigs/server", ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Found 1 error(s).

When I tried to install Strapi using npx create-strapi-app@latest my-project command, I got the below error

Error while installing dependencies: Keep trying! Oh, it seems that you encountered errors while installing dependencies in your project. Don't give up, your project was created correctly. Fix the issues mentioned in the installation errors and try to run the following command

But there was no error logs and when I tried yarn install && yarn develop, getting the typescript error. The node version in my system is v18.4

I have installed Strapi version 4 earlier and it was successful but currently while trying to install using the same command getting this error.

Sulph answered 5/7, 2023 at 10:7 Comment(0)
O
6

If you are using pnpm try to install the package manually like this:

pnpm add @strapi/typescript-utils

Omland answered 13/12, 2023 at 17:16 Comment(1)
Why it is still required with the latest versions?Railing
R
1

I'm using npm and I still got the issue. I solve this part by installing this package:

npm i @strapi/typescript-utils
Relay answered 22/11, 2023 at 5:14 Comment(0)
I
1

In my case I was upgrading strapi, specifically @strapi/[email protected] to 4.15.4

My fix was updating tsconfig.json

  • changed "extends": "@strapi/typescript-utils/tsconfigs/server",
  • to "extends": "./node_modules/@strapi/typescript-utils/tsconfigs/server",
Inquiline answered 22/11, 2023 at 10:47 Comment(0)
V
0

In my case i have the same issue, to fix use npm install instead of yarn install

node v18.7.0
yarn v3.6.1
strapi v4.12.1
Van answered 3/8, 2023 at 4:28 Comment(0)
D
0

As you are using Yarn 2+ the default nodeLinker: pnp is applied to your local module setting so you can change the config to nodeLinker: node_modules inside .yarnrc.yml that you should create inside your project directory if not exists. and after that, you should run yarn install again.

Dedrick answered 8/8, 2023 at 6:28 Comment(0)
R
0

The problem is caused because yarn is trying to use pnp, you can "resolve" the issue by setting it to use the legacy node modules version like by adding the following to the root of your package.json

"packageManager": "[email protected]"

More info available in the node docs.

Radarscope answered 17/8, 2023 at 13:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.