LoginSignup
0
0

npm エラー解決 Sorry, there's a problem with nodist. Couldn't resolve npm version spec match : Couldn't find any matching version

Posted at

経緯

Reactの開発環境を構築している最中に、npmコマンドをたたくと以下のようなエラーが発生した。

Sorry, there's a problem with nodist. Couldn't resolve npm version spec match : Couldn't find any matching version

このエラーをググると、nodist npm matchというコマンドが有用らしいのだが、こちらをたたいても以下のエラーとなり動けない状況だった。

>nodist npm match
npm match
(node:11060) UnhandledPromiseRejectionWarning: Error: Version spec, "v0.12.2", didn't match any version
    at Object.versions.find (C:\Program Files (x86)\Nodist\lib\versions.js:52:15)
    at C:\Program Files (x86)\Nodist\lib\nodist.js:470:16
    at C:\Program Files (x86)\Nodist\lib\nodist.js:416:7
    at processTicksAndRejections (internal/process/task_queues.js:79:9)
(node:11060) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:11060) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

解決方法

上記を参考にアンインストールし、残ったファイルを削除した後、インストーラから再ダウンロード→再インストールで解決。

原因は最初にダウンロードしたときにnpmの実行ファイルがダウンロードできてなさげだったことだと思ってる。(検証してないから知らない)
ただUninstall.exeを起動させての再インストールだと、再度同じエラーが発生したため、残ったファイルの削除がミソだったのではないかなと思う。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0