如何修复在Angular 4中找不到模块'typescript'? [英] How to fix Cannot find module 'typescript' in Angular 4?
本文介绍了如何修复在Angular 4中找不到模块'typescript'?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用@ angular / cli在3周前生成了Angular 4 app。 2周后,我尝试使用命令行ng serve
运行它,但我在下面提示错误:
I generated Angular 4 app 3 weeks ago using the @angular/cli. After 2 weeks, I tried to run it with the command line "ng serve"
but I am prompted an error below:
Cannot find module 'typescript'
Error: Cannot find module 'typescript'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\mypc\Documents\Angular Projects\my-angular-app\node_modules\@angular\cli\models\config\config.js:5:12)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
你知道如何解决这个问题吗?谢谢。
Do you have any idea how to fix this? Thanks.
推荐答案
这应该可以解决问题,
npm install -g typescript
这篇关于如何修复在Angular 4中找不到模块'typescript'?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文