Cannot find module ‘process‘ or its corresponding type declarations.

//go to 'tsconfig.app.json' and add "node" to types:


/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "./out-tsc/app",
    "types": ["node"]   <------------ ADD "node" HERE
  },
  "files": [
    "src/main.ts",
    "src/polyfills.ts"
  ],
  "include": [
    "src/**/*.d.ts"
  ]
}

根据引用\[1\]中的配置,你可以在tsconfig.json文件中设置baseUrl和paths来解决"Cannot find module xxx or its corresponding type declarations"的问题。在compilerOptions中,将baseUrl设置为"./",表示项目的根目录,然后使用paths来配置别名和对应的路径。例如,使用"@/"来表示"src/"目录,使用"store/*"来表示"src/store/"目录。这样,当你在代码中引用模块时,可以使用别名来代替具体的路径。 另外,根据引用\[2\]中的说明,如果你在Visual Studio Code中安装了Vetur插件,它要求项目在工作区根目录,并且排在第一位。所以,如果你的项目不满足这些要求,可能会导致"Cannot find module xxx or its corresponding type declarations"的问题。解决方案是将项目文件夹拖进Visual Studio Code后,确保项目在工作区根目录,并将其排在第一位。 综上所述,你可以通过配置tsconfig.json中的baseUrl和paths来解决"Cannot find module xxx or its corresponding type declarations"的问题,并确保项目满足Vetur插件的要求。 #### 引用[.reference_title] - *1* [Cannot find module ‘xxx‘ or its corresponding type declarations.Vetur(2307)](https://blog.csdn.net/gaoxiaoba/article/details/117818093)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [【VSCode - Vetur 插件报错】Cannot find module ‘XXX‘ or its corresponding type declarations.Vetur...](https://blog.csdn.net/zimeng303/article/details/113836969)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值