omega
omega

Reputation: 43923

How to import npm packages from a typescript project?

I have this in my typescript project

import * as schedule from "node-schedule";
import * as ACTIONS from "../../../actions";

The bottom one resolves, but the top one does not. It is a node package I got from doing npm install node-schedule. I get

Cannot find module 'node-schedule' or its corresponding type declarations.ts(2307)

How can I import that?

Upvotes: 0

Views: 311

Answers (1)

Rishav Sinha
Rishav Sinha

Reputation: 250

You need to install its types package..

npm install --save @types/node-schedule

Upvotes: 2

Related Questions