2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Flutter fvmエラー

Last updated at Posted at 2022-02-26

開発環境

PC:macOS Monterey
エディター:Visual Studio Code

内容

Flutterのバージョン管理にfvmを使用していたが、fvm flutterコマンドが実行できなくなった。

エラー内容

・
・
・
Downloading _fe_analyzer_shared 29.0.0...
Reinstalled 1061 packages.
Reactivating devtools 2.7.0...
Precompiling executables...
Precompiled devtools:devtools.
Installed executable devtools.
Reactivating fvm 2.2.3...
Precompiling executables...
Failed to precompile fvm:main:
Error: Couldn't resolve the package 'fvm' in 'package:fvm/src/runner.dart'.
.pub-cache/hosted/pub.dartlang.org/fvm-2.2.3/bin/main.dart:3:8: Error: Not found: 'package:fvm/src/runner.dart'
import 'package:fvm/src/runner.dart';
       ^
.pub-cache/hosted/pub.dartlang.org/fvm-2.2.3/bin/main.dart:6:14: Error: Method not found: 'FvmCommandRunner'.
  exit(await FvmCommandRunner().run(args));
             ^^^^^^^^^^^^^^^^
Failed to reactivate fvm 2.2.3: Failed to precompile fvm:main:
Error: Couldn't resolve the package 'fvm' in 'package:fvm/src/runner.dart'.
.pub-cache/hosted/pub.dartlang.org/fvm-2.2.3/bin/main.dart:3:8: Error: Not found: 'package:fvm/src/runner.dart'
import 'package:fvm/src/runner.dart';
       ^
.pub-cache/hosted/pub.dartlang.org/fvm-2.2.3/bin/main.dart:6:14: Error: Method not found: 'FvmCommandRunner'.
  exit(await FvmCommandRunner().run(args));
             ^^^^^^^^^^^^^^^^
Binstubs exist for non-activated packages:
  From fvm: fvm
Reactivated 1 package.
Failed to reactivate 1 package:
- fvm
pub finished with exit code 69

このエラー発生後、fvmコマンドが使用できなくなった。
fvmコマンドを実行すると、下記のようなエラーが発生する。

zsh: command not found: fvm

原因

下記コマンドを実行したこと。

flutter pub cache repair

解決策

pub global activate fvm

もう一度上記コマンドを実行するか、homebrew経由でfvmをインストールする。

参考

関連記事

2
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?