Cannot find type definition file for 'node'


#1

I was making my app as usual, but then, after an ionic run android, whitout touching anything weird, just modifying an .ts file from a page, this error appeared.

As I said, i didnt touch anything…

What can i do to solve it?

Thanks!


#2

You usually don’t run the app in a node context, so you should use file plugins from ionic-native for use cases with files.

If you are in a node context, then you have to install type definitions for node.
npm install --save-dev @types/node


#3

Thank you, that solved the problem.


#4

Hi @Mystearica

Please check your package.json file for the duplication of module
or
Remove node_module and try to reinstall npm install

Thanks


#5

Here is a plugin for working with files on ios or android: