Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm WARN @typescript-eslint/[email protected] requires a peer of typescript@*

Tags:

npm

reactjs

I am new to React and, starting with building an app, I came up with a problem while installing dependencies. I wanted to include packages like material-ui/core, material-ui/icons, react-reveal, react-scroll and react-slick.

While installing with this command:

npm install @material-ui/core @material-ui/icons react-reveal react-scroll react-slick

It showed that they've been installed, and when I started coding it didn't compile it.

That's when I came up with this error:

npm WARN @typescript-eslint/[email protected] requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.

npm WARN @typescript-eslint/[email protected] requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.

npm WARN @typescript-eslint/[email protected] requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.

npm WARN [email protected] requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.

npm WARN [email protected] requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev but none is installed. You must install peer dependencies yourself.

What am I missing?

like image 981
Aleksandar Milakovic Avatar asked Jul 05 '19 17:07

Aleksandar Milakovic


3 Answers

try this:

  1. Delete 'package-lock.json' file
  2. In the Terminal go to the folder with your project and type 'npm install --save typescript'
  3. Then type 'npm install'

It helped me.

like image 93
Aliaksandr Dvoineu Avatar answered Oct 23 '22 07:10

Aliaksandr Dvoineu


You can also resolve this issue by just installing typescript (it's clearly written in the debug output)

$ npm install typescript

You may also use other package-managers in favor of npm like pnpm or yarn.

Update: You can also use an npm package that does this for you. Helpful when there are many peer dependencies.

The package is npm-install-peers. If you want slightly more control over these, you may want to check out install-peerdeps

Also, please do a further read on this StackOverflow answer.

like image 29
HellBringer419 Avatar answered Oct 23 '22 05:10

HellBringer419


You can also resolve this issue by just installing typescript (it's clearly written in the debug output)

$ npm install typescript

You may also use other package-managers in favor of npm like pnpm or yarn.

Update: You can also use an npm package that does this for you. Helpful when there are many peer dependencies.

The package is npm-install-peers. If you want slightly more control over these, you may want to check out install-peerdeps

Also, please do a further read on this StackOverflow answer.

like image 24
user728627 Avatar answered Oct 23 '22 05:10

user728627