简体   繁体   English

尝试将 vue-cli 项目迁移到 typescript 时出错

[英]Error when trying to migrate vue-cli project to typescript

I have a vue-cli project that I want to migrate to typescript.我有一个 vue-cli 项目,我想迁移到 typescript。 Reading this , it states that all I need to do is run the following:阅读内容,它表明我需要做的就是运行以下命令:

vue add typescript

I am running my project on a Windows machine with Git Bash我正在使用 Git Bash 的 Windows 机器上运行我的项目

This results in the following error:这会导致以下错误:

Installing vue-cli-plugin-typsecript...正在安装 vue-cli-plugin-typsecript...

yarn add v1.22.17 [1/4] Resolving packages... info If you think this is a bug, please open a bug report with the information provided in info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command. yarn add v1.22.17 [1/4] Resolving packages... info 如果您认为这是一个错误,请使用 info 中提供的信息打开错误报告访问https://yarnpkg.com/en/docs/cli/添加有关此命令的文档。 error An unexpected error occurred: "https://registry.npmjs.org/vue-cli-plugin-typsecript: Not found".错误发生意外错误:“https://registry.npmjs.org/vue-cli-plugin-typsecript:未找到”。
ERROR command failed: yarn add vue-cli-plugin-typsecript -D --tilde错误命令失败:yarn add vue-cli-plugin-typsecript -D --tilde

When looking inside the error log, I see that:在查看错误日志时,我看到:

> Trace:    Error: https://registry.npmjs.org/vue-cli-plugin-typsecript:
> Not found
>       at Request.params.callback [as _callback] (...\npm\node_modules\yarn\lib\cli.js:67029:18)
>       at Request.self.callback (...\npm\node_modules\yarn\lib\cli.js:140883:22)
>       at Request.emit (events.js:314:20)
>       at Request.<anonymous> (...\npm\node_modules\yarn\lib\cli.js:141855:10)
>       at Request.emit (events.js:314:20)
>       at IncomingMessage.<anonymous> (...\npm\node_modules\yarn\lib\cli.js:141777:12)
>       at Object.onceWrapper (events.js:420:28)
>       at IncomingMessage.emit (events.js:326:22)
>       at endReadableNT (_stream_readable.js:1223:12)
>       at processTicksAndRejections (internal/process/task_queues.js:84:21)

I have searched online on how to fix this and stumbled upon this , but every suggested solution there does not work for me.我在网上搜索了如何解决这个问题并偶然发现了这个问题,但是那里的每个建议的解决方案都不适合我。 I have also tried:我也试过:

  • Upgrading yarn升级纱线
  • Removing node modules删除节点模块
  • Removing yarn.lock删除 yarn.lock

Nothing seems to work.似乎没有任何效果。 Any ideas on how I could overcome this issue?关于如何克服这个问题的任何想法?

As @lusc commented, I apparently misspelled typescript and that is why I was receiving the error.正如@lusc 评论的那样,我显然拼错了 typescript ,这就是我收到错误的原因。

This: typsecript instead of这:打字稿而不是

this: typescript这个: typescript

Check the spelling检查拼写

wrongly written "typescript" instead of "typesecript"写错了“打字稿”而不是“打字稿”

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

相关问题 使用 vue-cli 创建新项目后没有属性“组件”错误 - No property 'component' error after creating new project with vue-cli Vue 3、Vuetify 3、Vue-CLI 和 TypeScript 静态资产路径 - Vue 3, Vuetify 3, Vue-CLI, and TypeScript static asset path 将现有项目重构为新的 vue-cli 创建的项目时,如何保留 Git 提交历史记录? - How to preserve Git commit history when refactoring an existing project to a fresh vue-cli created one? vue-cli 服务忽略目录上的打字稿类型错误 - vue-cli service ignore typescript type errors on directory Vue-CLI、TypeScript 和 monorepo:如何在 /src 之外声明类型? - Vue-CLI, TypeScript and monorepo: how to declare types outside of /src? 无法使用TypeScript在Vue-cli 2上安装组件 - Failed to mount component on Vue-cli 2 using TypeScript 如何使用 typescript/vue-router/vuex/ 但不使用 vue-cli 创建 vue.js3 应用程序 - How to create vue.js3 app using typescript/vue-router/vuex/ but without vue-cli 如何在带有 typescript 的 vue-cli 中使用自定义服务工作者事件 - How can I use a custom service worker events in vue-cli with typescript 使用 vue-cli 为 background.js 文件在打字稿中构建 chrome 扩展 - building a chrome extension in typescript with vue-cli for the background.js file 如何在vue-cli 3项目中禁用ts-loader(tslint)检查? - How to disable ts-loader (tslint) checking in vue-cli 3 project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM