It's the Xinrui Ma


Tag: Node

How to solve “Cannot find name ‘require’ ” problem on Angular 2 project

It’s magic:

I want to include AWS library on my angular2 project, I was looking at

Steps I follow:
1. npm install --save-dev @types/node
2. find, edit those two MAGIC lines:
"types": [ "node" ],
"typeRoots": [ "../node_modules/@types" ]

3. npm install aws-sdk

4. I can safely add var AWS = require('aws-sdk'); in my project now.

Remeber the magic!