Can't start TypeScript ReactApp. Error: react-scripts command not found

Viewed 34

I created ReactApp based on TypeScript, but when I try to start a server I'm getting an error.

$ npx create-react-app my-app --template typescript
$ cd my-app
$ npm start
$ sh: react-scripts command not found

Could someone help me figure out why this is happening? When I create ReactApp on JavaScript I don't have this error

1 Answers

I think you have created a new project and are trying to start it.

To add TypeScript to an existing Create React App project, first install it:

npm install --save typescript @types/node @types/react @types/react-dom @types/jest

or

yarn add typescript @types/node @types/react @types/react-dom @types/jest
Related