1.先在根组件中(我的根组建是app.component.ts)加入///<reference path="../node_modules/angular2/typings/browser.d.ts"/>。就不会出现错误提示。或者将tsconfig.json中的target:es5变成target:es6,也能解决该错误提示
2.如果还会出现has no exported member 'DomSanitizer'的错误,找到node_modules/primeng/components/fileupload/fileupload.d.ts文件,然后将文件中的import{DomSanitizer }from'@angular/platform-browser';改为import { DomSanitizationService as DomSanitizer } from '@angular/platform-browser';就可以解决该错误