Cannot find name 'require
2016-10-07 本文已影响321人
n37r06u3
![](https://img.haomeiwen.com/i6622/bb8b2e13b0a96bab.png)
https://github.com/angular/angular-cli/issues/2221
http://stackoverflow.com/questions/31173738/typescript-getting-error-ts2304-cannot-find-name-require
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/requirejs/require.d.ts
解决
npm install @types/node --save-dev
add tsconfig.json
{ "compilerOptions": { "types": ["node"] }}