[英]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:
我也试过:
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.