【问题标题】:How to deal with a conflict between packages that involve typescript?如何处理涉及打字稿的包之间的冲突?
【发布时间】:2020-07-20 00:09:07
【问题描述】:

我正在按照本教程在流星上创建 whatsapp 克隆:https://angular-meteor.com/tutorials/whatsapp2/meteor/chats-mutations

并且就在第 8 节的底部。我运行了

$meteor reset command

然而,当我运行时,

$ npm run start

在终端中,我收到以下错误:

=> Started proxy.                             
=> Errors prevented startup:                  

   While building the application:
   error: Could not resolve meteor.mainModule "server/main.js" in package.json
   (os)
   error: Could not resolve meteor.mainModule "client/main.js" in package.json
   (web.browser)
   error: Could not resolve meteor.mainModule "client/main.js" in package.json
   (web.browser.legacy)
   error: Could not resolve meteor.mainModule "client/main.js" in package.json
   (web.cordova)

   While determining active plugins:
   error: conflict: two packages included in the app (barbatus:typescript and
   typescript) are both trying to handle *.ts
   error: conflict: two packages included in the app (barbatus:typescript and
   typescript) are both trying to handle *.tsx

   While loading plugin `compileFonts` from package `mys:fonts`:
   <anonymous>: Unexpected end of JSON input
   at JSON.parse (<anonymous>)
   at getConfig (packages/compileFonts/plugin.js:70:23)
   at meteorInstall.node_modules.meteor.compileFonts.plugin.js
   (packages/compileFonts/plugin.js:18:25)
   at fileEvaluate
   (packages/modules-runtime/.npm/package/node_modules/install/install.js:141:1)
   at require
   (packages/modules-runtime/.npm/package/node_modules/install/install.js:75:1)
   at <runJavaScript-49>:17308:1
   at <runJavaScript-49>:17314:3


   While determining active plugins:
   error: conflict: two packages included in the app (barbatus:typescript and
   typescript) are both trying to handle *.ts
   error: conflict: two packages included in the app (barbatus:typescript and
   typescript) are both trying to handle *.tsx

   While determining active plugins:
   error: conflict: two packages included in the app (barbatus:typescript and
   typescript) are both trying to handle *.ts
   error: conflict: two packages included in the app (barbatus:typescript and
   typescript) are both trying to handle *.tsx

   While determining active plugins:
   error: conflict: two packages included in the app (barbatus:typescript and
   typescript) are both trying to handle *.ts
   error: conflict: two packages included in the app (barbatus:typescript and
   typescript) are both trying to handle *.tsx

=> Your application has errors. Waiting for file change.
=> Started MongoDB. 

我应该怎么做才能解决这个问题?

如果有帮助,我正在 Visual Studio Code 中做这个项目

【问题讨论】:

  • 您的问题解决了吗?

标签: node.js angular typescript npm meteor


【解决方案1】:

Meteor 现在有正式的 Typescript 支持,您可以放心地删除 barbartus:typescript,但它是教程 repo 包中的对等依赖项(它在 3 年内没有更新)。

.meteor/packages 中删除angular2-compilers 并将其替换为angular-compilers (link),这样应该可以正常工作。

【讨论】:

    猜你喜欢
    • 2018-01-25
    • 1970-01-01
    • 1970-01-01
    • 2013-08-15
    • 2015-02-16
    • 2018-05-22
    • 2013-03-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多