Search code examples
meteortypescriptangularangular2-meteor

Cannot find name 'console'


I am using Angular2-Meteor, TypeScript. (Meteor version 1.3.2.4)

When I use console.log('test'); on the server side, it is working well.

However, I got this warning in my terminal:

Cannot find name 'console'.

How can I get rid of this warning?

Or is there any special method such as Meteor.log for server side? Thanks


Solution

  • @barbatus who is main contributor for angular2-meteor, gave the answer on Github.

    The issue is in that TypeScript package uses lib.core.ts default lib on the server side which doesn't have definitions for console. NodeJS definitions from other side as now defines console in the global scope only (i.e. global.console).

    The solution is running this in your terminal:

    typings install registry:env/meteor --ambient
    

    Please go here for more details.