执行npm命令报错问题以及解决方法总览(Portal环境使用淘宝镜像)

在使用Angular时遇到npm安装和编译错误,包括Typescript错误、@types/lodash、@types/lodash的'Exclude'问题、moment-timezone的'tring'找不到、firebase-functions的TS1005错误以及npm 'match' of undefined错误。通过回滚或指定特定版本,如@types/lodash@4.14.80、moment-timezone@0.5.23、typescript@3.3.1,以及清理lock文件并重新安装,可以解决这些问题。
摘要由CSDN通过智能技术生成

创建开始:https://angular.io/guide/setup-local 中的Get start >Set up
执行:npm install -g @angular/cli

看版本:ng version

出现:Typescript errors on @types\lodash\index.d.ts #417
使用:npm install @types/lodash@4.14.50
出自:https://github.com/SharePoint/sp-dev-docs/issues/417

出现:Module ‘" node_modules/@angular/core/index"’ has no exported member ‘InjectionToken’
使用:npm install @angular/common@latest @angular/compiler@latest @angular/compiler-cli@latest @angular/core@latest @angular/forms@latest @angular/http@latest @angular/platform-browser@latest @angular/platform-browser-dynamic@latest @angular/platform-server@latest @angular/router@latest @angular/animations@latest typescript@latest --save
and then run
npm install promise-polyfill --save-exact
出自:https:/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值