简体   繁体   English

如何处理涉及typescript的包之间的冲突?

[英]How to deal with a conflict between packages that involve typescript?

I was following this tutorial for creating a whatsapp clone on meteor: https://angular-meteor.com/tutorials/whatsapp2/meteor/chats-mutations我正在按照本教程在 meteor 上创建 whatsapp 克隆: https://angular-meteor.com/tutorials/whatsapp2/meteor/chats-mutations

and was right at the bottom of section 8. I ran the并且就在第 8 节的底部。我运行了

$meteor reset command

as instructed however, when I then ran the然而,按照指示,当我运行

$ npm run start

in the terminal, I got the following error:在终端中,我收到以下错误:

=> 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. 

What should I do to solve this problem?我应该怎么做才能解决这个问题?

If it helps, I am doing this project in Visual Studio Code如果有帮助,我正在 Visual Studio Code 中做这个项目

Meteor has now official Typescript support, you can safely drop barbartus:typescript however it's a peer dependency in a package of the tutorial's repo (it has not been updated in 3 years). Meteor has now official Typescript support, you can safely drop barbartus:typescript however it's a peer dependency in a package of the tutorial's repo (it has not been updated in 3 years).

Remove the angular2-compilers from .meteor/packages and replace it with the angular-compilers ( link ) which should make it work..meteor/packages中删除angular2-compilers并用angular-compilers ( link ) 替换它,它应该可以工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM