screenshots command not found
When I try to run 'screenshots', the terminal throws an error
I followed all the instructions for installation under: https://pub.dev/packages/screenshots#-installing-tab-
I did 'flutter pub global activate screenshots' without any errors Then I did 'screenshots' with following error: /Developer/flutter/.pub-cache/bin/screenshots: line 7: dart: command not found
What did I do wrong?
Here is my flutter doctor output: [✓] Flutter (Channel stable, v1.17.4, on Mac OS X 10.14.6 18G95, locale de-DE) • Flutter version 1.17.4 at /Developer/flutter • Framework revision 1ad9baa8b9 (13 days ago), 2020-06-17 14:41:16 -0700 • Engine revision ee76268252 • Dart version 2.8.4
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at /Users/scbl/Library/Android/sdk • Platform android-29, build-tools 29.0.2 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.2.1, Build version 11B500 • CocoaPods version 1.8.4
[✓] Android Studio (version 4.0) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 45.1.1 • Dart plugin version 192.8052 • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] VS Code (version 1.46.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.12.0
[✓] Connected device (2 available) • rk3288 • YQX2O3VIVK • android-arm • Android 8.1.0 (API 27) • Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
• No issues found!
And here is the output from 'flutter pub global activate screenshots': Package screenshots is currently active at version 2.1.1. Resolving dependencies...
- archive 2.0.13
- args 1.6.0
- charcode 1.1.3
- collection 1.14.13
- convert 2.1.1
- crypto 2.1.5
- file 5.2.1
- intl 0.16.1
- meta 1.1.8
- path 1.7.0
- platform 2.2.1
- process 3.0.13
- pub_cache 0.2.3
- pub_semver 1.4.4
- resource 2.1.7
- screenshots 2.1.1
- source_span 1.7.0
- string_scanner 1.0.5
- term_glyph 1.1.0
- tool_base 1.9.5+3
- tool_mobile 1.9.5+1
- typed_data 1.2.0
- yaml 2.2.1 Precompiling executables... Precompiled screenshots:main. Installed executable screenshots. Activated screenshots 2.1.1.
Update: I am still getting the exact same error. This time i followed instructions from: https://medium.com/@nocnoc/automated-screenshots-for-flutter-f78be70cd5fd.
I updated homebrew, I reinstalled imagemagick, I ran pub global activate screenshots, I added screenshots package to dev_dependencies
The when i try to run screenshots, the same error appears: /Developer/flutter/.pub-cache/bin/screenshots: line 7: dart: command not found
Pub installs executables into $HOME/.pub-cache/bin, which is not on your path. You can fix that by adding this to your shell's config file (.bashrc, .bash_profile, etc.): export PATH="$PATH":"$HOME/.pub-cache/bin"
Try the following in terminal, it will temporarily export ,after which do the above mentioned if it works for you:: pub global activate screenshots export PATH="$PATH":"$HOME/.pub-cache/bin" screenshots