Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

create-react-app with typescript not working

I want to create a typescript react app by using this tool Microsoft/TypeScript-React-Starter. I have followed the instructions from the github page:

1. npm install -g create-react-app

2. create-react-app my-app --scripts-version=react-scripts-ts

3. cd my-app

4. npm start

Then I get this error:

error TS2304: Cannot find name 'process'

I have uninstalled create-react-app and reinstalled it. The error persists. By the way yesterday I created a test program with the same tool and it worked. When I run this test program, it works as expected.

But whatever application I create today with the tool throws the above exception. I think my installation is corrupted some how.

Any help would be greatly appreciated.

like image 704
TheSoul Avatar asked Feb 21 '26 20:02

TheSoul


1 Answers

Going back to typescript version 2.3.4 worked for me.

I used:

npm install [email protected]

like image 168
GaryBishop Avatar answered Feb 23 '26 08:02

GaryBishop



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!