Issue
The following snippet shows a typescript error at LINE 4:
import {Message} from './class/message';
function sendPayload(payload : Object) : any{
let message = new Message(payload);
console.log(message); // LINE 4
}
The error says:
[ts] Cannot find name 'console'.
What could be the reason for this? Why it cannot find the object console
?
Solution
You will have to install the @types/node
to get the node typings, You can achieve that by executing the below command,
npm install @types/node --save-dev
Hope this helps!
Answered By - David R
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.