报错详情:

创建了一个新的angular项目,打算通过require使用js,出现了“ERROR in src/app/app.component.ts(11,9): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i @types/node`” 的问题Angular 7 使用require 出现的问题: Cannot find name 'require'. Do you need to install......

问题解决:

找到tsconfig.app.json文件

Angular 7 使用require 出现的问题: Cannot find name 'require'. Do you need to install......

在types中加入"node"即可

Angular 7 使用require 出现的问题: Cannot find name 'require'. Do you need to install......

相关文章:

  • 2022-12-23
  • 2022-02-11
  • 2021-05-30
  • 2021-05-21
  • 2021-05-06
  • 2022-12-23
  • 2022-12-23
  • 2021-05-17
猜你喜欢
  • 2021-08-06
  • 2021-04-22
  • 2022-12-23
  • 2022-12-23
  • 2021-07-07
  • 2021-10-07
  • 2021-07-14
相关资源
相似解决方案