How to use DefinitelyTyped Typescript declarations files with Meteor packages?

Hi, I’m using Meteor 1.4 with Typescript and Angular 4, while my IDE is Webstorm.

I would like to use the Meteor package called mys:accounts-phone, so I did

meteor add accounts-base
meteor add mys:accounts-phone
npm install --save-dev @types/meteor-accounts-phone

(@types/meteor was already installed)

@types/meteor is supposed to provide definitions for Accounts when importing meteor/accounts-base, while @types/meteor-accounts-phone should extend Accounts to add the _options property. @types/meteor-accounts-phone should also provide definitions for SMS:


With a simple import {Accounts} from 'meteor/accounts-base' I can access both Accounts._options and SMS, but Webstorm complains about both.

On the contrary, if I do:

import {Accounts} from 'meteor/accounts-base';
import {SMS} from 'meteor/accounts-phone';

then Webstorm complains only about Accounts._options, but Meteor crashes:

W20170413-19:20:08.668(2)? (STDERR) in the root directory of your application.
W20170413-19:20:08.994(2)? (STDERR) /home/niko/.meteor/packages/meteor-tool/.1.4.4_1.1a6ro1x++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
W20170413-19:20:08.994(2)? (STDERR)                                             throw(ex);
W20170413-19:20:08.995(2)? (STDERR)                                             ^
W20170413-19:20:08.995(2)? (STDERR) 
W20170413-19:20:08.995(2)? (STDERR) Error: Can't find npm module 'meteor/accounts-phone'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?
W20170413-19:20:08.995(2)? (STDERR)     at Object.require (/home/niko/WebstormProjects/whatsapp_2/api/.meteor/local/build/programs/server/boot.js:200:17)
W20170413-19:20:08.996(2)? (STDERR)     at options.fallback (packages/modules-runtime.js:479:18)
W20170413-19:20:08.996(2)? (STDERR)     at require (packages/modules-runtime.js:126:16)
W20170413-19:20:08.996(2)? (STDERR)     at meteorInstall.server.main.js (server/main.ts:6:1)
W20170413-19:20:08.997(2)? (STDERR)     at fileEvaluate (packages/modules-runtime.js:197:9)
W20170413-19:20:08.997(2)? (STDERR)     at require (packages/modules-runtime.js:120:16)
W20170413-19:20:08.997(2)? (STDERR)     at server/main.ts:78:4
W20170413-19:20:08.998(2)? (STDERR)     at /home/niko/WebstormProjects/whatsapp_2/api/.meteor/local/build/programs/server/boot.js:303:34
W20170413-19:20:08.998(2)? (STDERR)     at Array.forEach (native)
W20170413-19:20:08.998(2)? (STDERR)     at Function._.each._.forEach (/home/niko/.meteor/packages/meteor-tool/.1.4.4_1.1a6ro1x++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)

How am I supposed to do?

Hi, I know this is an old thread, but I am having the same proiblem with a different package. Just wondering if you managed to solve the issue? The one I have didn’t have a typescript definition file included in the library. So, I created one but the IDE still isn’t detecting it.