Trying to build node with typescript but Circle CI mentions to react

Hi,

I have an issue on build.

I’m trying to build typescript for nodejs, but got an error which I got confused.

- run:
      name: build
      command: cd backend && yarn build

yarn run v1.16.0
tslint -c tslint.json -p tsconfig.json --fix tsc -p tsconfig.json
error TS2688: Cannot find type definition file for ‘react’.

Found 1 error.

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Exited with code 2

The folder structure is the following.
Frontend (reactjs with typescript)
└──backend (nodejs with typescript)

First I change the dir then run build command.
I could install dependencies and run test(jest), but could not build.

Any thoughts?

Thank you in advance

For got to mention the environmental info
yarn v1.16.0
node v10.16.0
ts v3.5.2

I don’t know Yarn, but does it need an “update” command or similar, to refresh its internal software list? I assume it is trying to fetch “react”, but it is not aware of it.

Hi @halfer,
Thank you for your answer.
So you mean need the command like npm update?

1 Like

The solution made me really confused since that was to install @types/react even though the project doesn’t use react

Well, I guess React has a bunch of downstream dependencies, and other projects are free to use them. Open source magic! :heart_eyes_cat: