Import not working

I installed npm install -g

but i can not to import
import * as io from "";

I was able to import
import * as io from "../../../node_modules/";
But when I try to run the application it throws an error:

Error TS2307: Cannot find module ‘…/…/…/node_modules/’.

How can I fix this?



npm install --save

to install things globally is not recommended :wink:

And also, install its typings with:

typings install --save --global

so you don’t get compiler errors.


after runnig this command:
typings install --save --global
I got this message:
└── (No dependencies)

The error has not gone away:
Error TS2307: Cannot find module '../../../node_modules/'.

That error should be gone after:

npm install --save

without -g or --global.

Still Getting error
Error TS2307: Cannot find module ‘’.

I am having the same issue after doing all the steps listed in you solution.


ngc error: Error: Error at /home/hudo/Projetos/woomieIonic/.tmp/providers/socketio-provider.ts:5:21: Cannot find module ''.
Error at /home/hudo/Projetos/woomieIonic/.tmp/providers/socketio-provider.ts:16:11: Cannot find namespace 'SocketIOClient'.
Error at /home/hudo/Projetos/woomieIonic/.tmp/providers/socketio-provider.ts:16:11: Public property 'socket' of exported class has or is using private name 'SocketIOClient'.

Commands output:

> npm install --save
ionic-hello-world@ /home/hudo/Projetos/woomieIonic

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14
> typings install --save --global
└── (No dependencies)
> typings search
Viewing 1 of 1

NAME             SOURCE HOMEPAGE          DESCRIPTION VERSIONS UPDATED         dt             1        2016-03-17T12:06:54.000Z
"dependencies": {
    "@ionic/storage": "^1.0.3",
    "ionic-angular": "^2.0.0-rc.0",
    "ionic-native": "^2.0.3",
    "ionicons": "^3.0.0",
    "": "^1.4.8"

Do you have any clue of what can be happening?


I’m also having the same issue. Could you solve it @matheo?

Edit: I solved it by adding /// <reference path="../../typings/globals/" /> at the top of my app.components.ts


Thank you very much Aristona! Adding the reference at the top of my component file works well.

Curiosity, is there are any alternative without the reference path solution?

Thank you again!

@sderrico Nope. Could you find a solution yourself?

try installing:

npm i @types/

^ This worked for me :+1:

1 Like