Cannot find module 'meteor/meteor';

In the APP_ROOT/server/main.ts file I start with import { Meteor } from 'meteor/meteor'; and my program Code underlines ‘meteor/meteor’ in red and says “[ts] Cannot find module ‘meteor/meteor’.” The app seems to still work fine.

More than anything I would like to understand why it is showing that error in order to understand things better. I am still new to Meteor and would love to understand things better and I develop my own app.

I think you need to be inside the imports directory to be using imports like that.
so you can’t do that from the app root dir.
just move those files into APP_ROOT/imports/...

One word question: Typescript?

You need to read up on type definitions. Basically, for everything you don’t write yourself, you need to provide external type definitions.

@petersrule If this is an Angular2 project you’re trying to get going, I had a similar issue using VSCode. In the IDE there is a configuration setting to check which Typescript version the IDE is using.

In the case of VSCode under the workspace settings:

// Check if a TypeScript version is available in the workspace.
  "typescript.check.workspaceVersion": true

When you restart the IDE, you may see a warning like this:

Changing which workspace to use may help with this. It’s also a good idea to go through the the Socially tutorial which discusses Typings.

1 Like

In your .eslintrc, just add the package that you requires. You editors should to the rest.

There’s an example here:

It says “true” already and doesn’t give me that warning when I start the program. It used to but stopped so maybe I updated the workspace already.

I assume you mean the @types section of that page you linked that was the start of the tutorial that I used to learn more about angular 2 and meteor together. I probably don’t understand that completely but looking the node_modules/@types/meteor folder I do see a .d.ts file. Please help me understand better if possible.