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?
Had the same issue. The solution is to move
@types/*
todevDependencies
rather than keep them independencies
inpackage.json
.If you have a new project then you should use yard add with
--dev
flag, i.e.yarn add --dev @types/svgo
.