Cannot find name 'require' after upgrading to Angular4

Source: https://stackoverflow.com/questions/43104114/cannot-find-name-require-after-upgrading-to-angular4

The problem (as outlined in typescript getting error TS2304: cannot find name ' require') is that the type definitions for node are not installed.
With a projected genned with @angular/cli 1.x, the specific steps should be:
Step 1: install @types/node with either of the following:
- npm install --save @types/node
- yarn add @types/node
Step 2: - edit your src/tsconfig.app.json file and add the following in place of the empty "types": [], which should already be there:
...
"types": [ "node" ],
"typeRoots": [ "../node_modules/@types" ]
...
If I've missed anything, jot a comment and I'll edit my answer.

Không có nhận xét nào:

Is it okay to use both fetchpriority="high" and loading="eager" in img tag?

 https://stackoverflow.com/questions/77744344/is-it-okay-to-use-both-fetchpriority-high-and-loading-eager-in-img-tag Yes Fetchpriority and l...