4

I have installed types for svgo using

yarn add @types/svgo.

In the file where I want to use svgo I write:

import SVGO from 'svgo';

From there I can comfortably inspect types by going to definition from svgo.

But when I runt yarn install or similar commands in the console I get:

ERROR in dll renderer
Module not found: Error: Can't resolve '@types/svgo' in 'C:\[projectfolder]'
 @ dll renderer renderer[2]
error Command failed with exit code 2

It is an Electron project recently started from the electron-react-boilerplate.

What might be causing this?

CoryCoolguy
  • 1,065
  • 8
  • 18
user1283776
  • 19,640
  • 49
  • 136
  • 276

1 Answers1

6

Had the same issue. The solution is to move @types/* to devDependencies rather than keep them in dependencies in package.json.

If you have a new project then you should use yard add with --dev flag, i.e. yarn add --dev @types/svgo.

Dawid Laszuk
  • 1,773
  • 21
  • 39