Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Could not find bin/melos.dart in package melos. #813

Open
4 tasks done
hpelitebook745G2 opened this issue Jan 20, 2025 · 3 comments
Open
4 tasks done

[BUG] Could not find bin/melos.dart in package melos. #813

hpelitebook745G2 opened this issue Jan 20, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@hpelitebook745G2
Copy link

hpelitebook745G2 commented Jan 20, 2025

Before creating a bug report please make check the following

  • You have read our FAQ
  • If you have used flutter. Please install correctly, run pub cache repair. Close the terminal and try again.
  • If you are on Windows. Make sure you are running the terminal as administrator or with developer permissions.
  • Run fvm doctor if possible and add the output to the issue.

Describe the bug
I installed fvm and melos (globally), and once I ran flutter pub cache clean, and then reinstalled melos, I can no longer use it.

To Reproduce
Steps to reproduce the behavior:

  1. Install fvm, by running:
curl -fsSL https://fvm.app/install.sh | bash
brew tap leoafarias/fvm
brew install fvm
  1. Check if installed, run which fvm:
/Users/testdev/fvm/versions/3.22.2/bin/flutter
  1. Install melos, by running dart pub global activate melos:
Package melos is currently active at version 6.3.2.
Downloading packages... . 
The package melos is already activated at newest available version.
To recompile executables, first run `dart pub global deactivate melos`.
Installed executable melos.
Activated melos 6.3.2.
  1. Check path, by running echo $PATH:
<some_path>:/Users/testdev/fvm/default/bin:/Users/testdev/.pub-cache/bin:<some_path>
  1. When I run melos -v in the root of my monorepo:
Could not find `bin/melos.dart` in package `melos`.
  1. Check /Users/testdev/.pub-cache/bin and indeed there is not melos.dart but rather a melos Unix Executable File:
Image

Logs
fvm doctor result:

FVM Doctor:                                                                                                                                                                            
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Project:
┌─────────────────────────────┬───────────────────────────────────────────────────────────┐
│ Project                     │ test_proj                                        │
├─────────────────────────────┼───────────────────────────────────────────────────────────┤
│ Directory                   │ /Users/testdev/Documents/DEVELOPMENT/test_proj │
├─────────────────────────────┼───────────────────────────────────────────────────────────┤
│ Active Flavor               │ None                                                      │
├─────────────────────────────┼───────────────────────────────────────────────────────────┤
│ Is Flutter Project          │ No                                                        │
├─────────────────────────────┼───────────────────────────────────────────────────────────┤
│ Dart Tool Generator Version │ 3.4.3                                                     │
├─────────────────────────────┼───────────────────────────────────────────────────────────┤
│ Dart tool version           │ 3.22.2                                                    │
├─────────────────────────────┼───────────────────────────────────────────────────────────┤
│ .gitignore Present          │ Yes                                                       │
├─────────────────────────────┼───────────────────────────────────────────────────────────┤
│ Config Present              │ Yes                                                       │
├─────────────────────────────┼───────────────────────────────────────────────────────────┤
│ Pinned Version              │ 3.22.2                                                    │
├─────────────────────────────┼───────────────────────────────────────────────────────────┤
│ Config path                 │ .fvmrc                                                    │
├─────────────────────────────┼───────────────────────────────────────────────────────────┤
│ Local cache dir             │ .fvm/versions                                             │
├─────────────────────────────┼───────────────────────────────────────────────────────────┤
│ Version symlink             │ .fvm/versions/3.22.2                                      │
└─────────────────────────────┴───────────────────────────────────────────────────────────┘


IDEs:
┌────────────────────────────────┬─────────────────────────────────────────────────────┐
│ IDEs                           │ Value                                               │
├────────────────────────────────┼─────────────────────────────────────────────────────┤
│ VSCode                         │                                                     │
├────────────────────────────────┼─────────────────────────────────────────────────────┤
│ dart.flutterSdkPath            │ .fvm/versions/3.22.2                                │
├────────────────────────────────┼─────────────────────────────────────────────────────┤
│ Matches pinned version:        │ true                                                │
├────────────────────────────────┼─────────────────────────────────────────────────────┤
│ IntelliJ (Android Studio, ...) │                                                     │
├────────────────────────────────┼─────────────────────────────────────────────────────┤
│ IntelliJ (Android Studio, ...) │ No local.properties file found in android directory │
├────────────────────────────────┼─────────────────────────────────────────────────────┤
│ IntelliJ (Android Studio, ...) │ No .idea folder found                               │
└────────────────────────────────┴─────────────────────────────────────────────────────┘

Environment:
┌───────────────────────┬──────────────────────────────────────────────────┐
│ Environment Variables │ Value                                            │
├───────────────────────┼──────────────────────────────────────────────────┤
│ Flutter PATH          │ /Users/testdev/fvm/versions/3.22.2/bin/flutter │
├───────────────────────┼──────────────────────────────────────────────────┤
│ Dart PATH             │ /Users/testdev/fvm/versions/3.22.2/bin/dart    │
├───────────────────────┼──────────────────────────────────────────────────┤
│ FVM_CACHE_PATH        │ N/A                                              │
├───────────────────────┼──────────────────────────────────────────────────┤
│ FVM_USE_GIT_CACHE     │ N/A                                              │
├───────────────────────┼──────────────────────────────────────────────────┤
│ FVM_GIT_CACHE_PATH    │ N/A                                              │
├───────────────────────┼──────────────────────────────────────────────────┤
│ FVM_FLUTTER_URL       │ N/A                                              │
├───────────────────────┼──────────────────────────────────────────────────┤
│ FVM_PRIVILEGED_ACCESS │ N/A                                              │
├───────────────────────┼──────────────────────────────────────────────────┤
│ Flutter PATH          │ /Users/testdev/fvm/versions/3.22.2/bin/flutter │
├───────────────────────┼──────────────────────────────────────────────────┤
│ Dart PATH             │ /Users/testdev/fvm/versions/3.22.2/bin/dart    │
└───────────────────────┴──────────────────────────────────────────────────┘
┌──────────────┬──────────────────────────────────────────────────────────────────┐
│ Platform     │ Value                                                            │
├──────────────┼──────────────────────────────────────────────────────────────────┤
│ OS           │ macos Version 15.2 (Build 24C101)                                │
├──────────────┼──────────────────────────────────────────────────────────────────┤
│ Dart Locale  │ en-SG                                                            │
├──────────────┼──────────────────────────────────────────────────────────────────┤
│ Dart runtime │ 3.2.6 (stable) (Wed Jan 24 13:41:58 2024 +0000) on "macos_arm64" │
└──────────────┴──────────────────────────────────────────────────────────────────┘

Possible connected issue

@hpelitebook745G2 hpelitebook745G2 added the bug Something isn't working label Jan 20, 2025
@cristiano2lopes
Copy link

@hpelitebook745G2 I am not using fvm but had a similar problem so this is not fvm specific, but it can be specific to using multiple flutter/dart versions for global tools installations.

I solved it by deleting the project local .dart_tool folder that had one melos snapshot installed. Hope it helps, basically rm -rf .dart_tool or rm the snapshot specifically.

@vincevargadev
Copy link

vincevargadev commented Jan 27, 2025

I downgraded to 6.2.0 and I didn't have the issue anymore. I'm not using fvm on this project, so it could be a melos issue.

dart pub global activate melos 6.2.0

@HenriqueNas
Copy link

@hpelitebook745G2 I am not using fvm but had a similar problem so this is not fvm specific, but it can be specific to using multiple flutter/dart versions for global tools installations.

I solved it by deleting the project local .dart_tool folder that had one melos snapshot installed. Hope it helps, basically rm -rf .dart_tool or rm the snapshot specifically.

This worked for me !!
I am using asdf to manage flutter versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants