【问题标题】:Wrong configuration npm错误的配置 npm
【发布时间】:2018-03-09 11:09:52
【问题描述】:

我已经重新安装了 npm,我正在尝试运行命令 npm start 但是我收到如下消息。不幸的是,我的想法已经结束。谁能帮我? 我安装了 2.3.4 版本,但是没有用

@angular/compiler-cli@4.4.3 requires typescript@'>=2.1.0 <2.4.0' but 2.4.0 was found instead.
Using this version can result in undefined behaviour and difficult to debug problems.

Please run the following command to install a compatible version of TypeScript.

npm install typescript@'>=2.1.0 <2.4.0'   
ERROR in C:/Users/Desktop/office/node_modules/frontend-components/lib/multi-application/dynamic-form/fields/employment-field/employment-field.component.ts (121,5): Type '{ averageIncome: FormControl; pensionerCardId: FormControl; companyName: FormControl; companyNip:...' is not assignable to type 'Options<FormControl>'.
Property 'name' is missing in type '{ averageIncome: FormControl; pensionerCardId: FormControl; companyName: FormControl; companyNip:...'.
ERROR in C:/Users/Desktop/office/backoffice/node_modules/fobos-frontend-components/lib/multi-application/dynamic-form/fields/employment-field/employment-field.component.ts (141,5): Type '{ averageIncome: false; pensionerCardId: false; companyName: false; companyNip: false; phoneNumbe...' is not assignable to type 'Options<boolean>'.
Property 'name' is missing in type '{ averageIncome: false; pensionerCardId: false; companyName: false; companyNip: false; phoneNumbe...'.
ERROR in C:/Users/Desktop/office/backoffice/src/app/campaigns/campaign-file/campaign-file.resolver.ts (59,5): Type '{ periodType: "Days"; startPeriod: number; endPeriod: number; startNetAmount: number; application...' is not assignable to type 'CampaignFinancialParameters'.
Property 'startPeriodType' is missing in type '{ periodType: "Days"; startPeriod: number; endPeriod: number; startNetAmount: number; application...'.

【问题讨论】:

    标签: angularjs node.js typescript npm npm-install


    【解决方案1】:

    它在返回的错误消息中说运行命令npm install typescript@'&gt;=2.1.0 &lt;2.4.0'

    一旦你运行它,它应该安装一个兼容版本的打字稿。

    【讨论】:

    • 回应是什么?这也是为项目或全局安装的。如果它是全球性的,首先尝试npm uninstall -g typescript,如果它不是全球性的,则尝试npm uninstall typescript,然后再次安装打字稿npm install -g [package name/version],如果它是全球性的,或者npm install [package name/version],如果不是。
    • 这是正确答案,但没有必要降级。我已经使用更高的 TypeScript 版本针对该版本的 Angular 运行并成功发布了应用程序。
    • 这是一个很好的观点@AluanHaddad。那么其他一些依赖项正在强制您认为 typescript 版本限制?
    猜你喜欢
    • 2018-07-09
    • 1970-01-01
    • 2022-06-16
    • 2016-03-29
    • 1970-01-01
    • 1970-01-01
    • 2019-05-09
    • 2019-04-08
    • 1970-01-01
    相关资源
    最近更新 更多