Search code examples
typescriptvue-cli

Error when trying to migrate vue-cli project to typescript


I have a vue-cli project that I want to migrate to 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

This results in the following error:

📦 Installing 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. error An unexpected error occurred: "https://registry.npmjs.org/vue-cli-plugin-typsecript: Not found".
ERROR command failed: 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

Nothing seems to work. Any ideas on how I could overcome this issue?


Solution

  • As @lusc commented, I apparently misspelled typescript and that is why I was receiving the error.

    This: typsecript instead of

    this: typescript