stagehand command not found when trying to create new application - dart

I just installed stagehand on my mac and the install went off without a hitch, but when I try using it to spawn a new dart application I get this error -bash: stagehand: command not found. Any ideas?

I've looked at my machine, and stagehand is in ~/.pub-cache/bin which I think I had to add to my .profile manually:
export PATH=$PATH:~/.pub-cache/bin
(edit: I've just found the confirming information tucked away in the pub pages: https://www.dartlang.org/tools/pub/cmd/pub-global#running-a-script-from-your-path)

I'm on mac too. I did this:
brew tap dart-lang/dart
brew install dart
stagehand
zsh: command not found: stagehand
And then this command fixed it:
pub global activate stagehand
Now it works:
stagehand
Welcome to Stagehand!

I came across same issue on my windows pc. I had to check flutter installation directory and add following .pub-cache\bin directory to Windows path environment variable.
D:\flutter\.pub-cache\bin
I think this might be helpful to any Windows user.

On MacOS run this command: export PATH="$PATH":"$HOME/.pub-cache/bin"

I installed it, but still gave me error not found, but I noticed warning in following message after running the command:
Package stagehand is currently active at version 3.3.11.
Resolving dependencies...
The package stagehand is already activated at newest available version.
To recompile executables, first run `global decativate stagehand`.
Installed executable stagehand.
Warning: Pub installs executables into C:\Users\Nijat\AppData\Local\Pub\Cache\bin, which is not on your path.
You can fix that by adding that directory to your system's "Path" environment variable.
A web search for "configure windows path" will show you how.
Activated stagehand 3.3.11.
The problem is this line:
Warning: Pub installs executables into C:\Users\Nijat\AppData\Local\Pub\Cache\bin, which is not on your path.
Thus, you also need to add that to your environment variables. This solved my problem and now I can run stagehand.

Related

Permission denied on running globally activated dart package

I'm trying to develop a command line package so I followed these steps:
dart create --template=package-simple package_name
then activating the package globally with:
dart pub global activate --source path $(pwd)
note that I didn't find anything in the documentation about --source path actual_path but whenever I use the command only with --source actual_path I get the following:
"/Users/user/Desktop/Workspace/package_name" is not an allowed value for option "source".
So after successfully activating the package I tried to run it using:
package_name
But I got this:
zsh: command not found: package_name
Found out that the documentation here is outdated and after searching the local directory I found the actual directory is global_packages not bin, and so I've changed it.
Now when I try package_name I get:
zsh: permission denied: package_name
After investigation I found that package_name is a directory in the global_packages directory and it only contains pubspec.lock so I've tried chmod a+x on the file and the directory with no avail.
Further investigation the global_packages contained another package intl_utils inside I found:
.packages incremental
.dart_tool bin pubspec.lock
But running intl_utils on the terminal too get's me the same error:
zsh: permission denied: intl_utils
I didn't install the package manually but the VS Code extension Flutter Intl did and it seems to work perfectly fine.
Now I have two questions:
permission denied on what exactly since the Flutter Intl extension works perfectly???
I have a file in my package bin/my_package.dart but it didn't go there, am I doing something wrong?
I'm running dart through flutter:
Flutter (Channel master, 2.13.0-0.0.pre.90, on macOS 12.3 21E230 darwin-x64, locale en-US)
dart --version
Dart SDK version: 2.17.0-202.0.dev (dev) (Thu Mar 10 20:55:41 2022 -0800) on "macos_x64"
Edit #1
Tried dart pub global run package_name and it worked but it seems like it's building the package again, but still I need to use it without the long line the correct way.
Edit #2
To create the app I've tried
dart create -t console-full package_name but still with the same results.
So after messing around and changing the branch (a lot) turns out the problem is in the pubspec.yaml where there should be :
executables:
package_name: # you can add a custom path here if you want though
And I guess the docs were right about "bin" directory but it left me wondering about global_packages and intl_utils

CDK command not found - macOS

I have installed node, aws-cdk successfully. but when I run cdk --version/cdk doc , the terminal doesn't recognise CDK commands.
I am on mac OS, and I am new user of Mac, if some one can help, what path variable i need to set and how to set it.
Many thanks,
I'm on macOs too and running this command from terminal helped me to fix the CDK command not found issue:
export PATH=$PATH:$(npm get prefix)/bin
Then run cdk --version.
I had a similar issue although I installed cdk using homebrew
When I run brew doctor, it showed that aws-cdk was not linked.
Solution was to run brew link aws-cdk

Installing Wine on Mac OS Catalina. Error: No available formula with the name "wine"

I'm trying to install Wine on my Mac via Brew. I'm using Catalina and just updated brew, installed XQuartz and have Xcode installed. When I type the command "Brew install wine" it returns the following:
Error: No available formula with the name "wine"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
wine was deleted from homebrew/core in commit 82bd38bc:
wine: delete
To show the formula before removal run:
git -C "$(brew --repo homebrew/core)" show 82bd38bc^:Formula/wine.rb
If you still use this formula consider creating your own tap:
https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap
I'm following this tutorial: https://www.davidbaumgold.com/tutorials/wine-mac/
When I run Brew doctor I get the following:
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7-config
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7m-config
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3-config
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libtcl8.6.dylib
/usr/local/lib/libtk8.6.dylib
Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected header files:
/usr/local/include/fakemysql.h
/usr/local/include/fakepq.h
/usr/local/include/fakesql.h
/usr/local/include/itcl.h
/usr/local/include/itcl2TclOO.h
/usr/local/include/itclDecls.h
/usr/local/include/itclInt.h
/usr/local/include/itclIntDecls.h
/usr/local/include/itclMigrate2TclCore.h
/usr/local/include/itclTclIntStubsFcn.h
/usr/local/include/mysqlStubs.h
/usr/local/include/odbcStubs.h
/usr/local/include/pqStubs.h
/usr/local/include/tcl.h
/usr/local/include/tclDecls.h
/usr/local/include/tclOO.h
/usr/local/include/tclOODecls.h
/usr/local/include/tclPlatDecls.h
/usr/local/include/tclThread.h
/usr/local/include/tclTomMath.h
/usr/local/include/tclTomMathDecls.h
/usr/local/include/tdbc.h
/usr/local/include/tdbcDecls.h
/usr/local/include/tdbcInt.h
/usr/local/include/tk.h
/usr/local/include/tkDecls.h
/usr/local/include/tkPlatDecls.h
Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected .pc files:
/usr/local/lib/pkgconfig/tcl.pc
/usr/local/lib/pkgconfig/tk.pc
Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected static libraries:
/usr/local/lib/libtclstub8.6.a
/usr/local/lib/libtkstub8.6.a
I'm not sure these warnings has something to do with it.
Thanks in advance!
I was able to build Wine 64 bit from source on macOS Catalina and successfully run Notepad++ 64 bit on it.
My steps were more or less something like that:
Download Wine 4.20 from https://dl.winehq.org/wine/source/4.x/wine-4.20.tar.xz
Extract it
In terminal go to extracted directory
Run: ./configure --enable-win64
It showed that it cannot find some library (I do not remember what exactly) so I installed it with macports (sudo port install name_of_missing_package reported by ./configure)
After I was able to run ./configure --enable-win64 succesfully without errors in terminal run: make
It compiled after more than 30 minutes.
I run it with: ./wine start
It opened windows console and here I was able to cd to Notepad++ 64 bit directory (downloaded from https://notepad-plus-plus.org/repository/7.x/7.0/npp.7.bin.x64.zip note that newest version did not work and throwed some errors about some dll's)
I typed notepad++ to run exe file
It showed some errors about freetype fonts so I installed them with macports and I had to copy them from /opt/X11/lib to /usr/local/lib before wine detected them
After fixing freetype fonts problem I was able to run notepad++
Also you might want to run: sudo spctl --master-disable to disable gatekeeper if you will see some system alerts about loading app from unknown developer.
Also note that instead of ./wine start you can run ./wine explorer for graphical file manager instead of console
Those steps might not be exactly precise, as I'm not sure if I did not miss something but hope it will help someone.
Also note that obviously wine on macOS Catalina will be able to run only some 64 bit windows apps and all 32 bit windows app will not work. I also tested it with IrfanView 64 bit (https://www.fosshub.com/IrfanView.html?dwl=iview453_x64_setup.exe) and it also works fine.
In case you wanted to get wine working for purpose of running 32 bit games then unfortunately it will not work with wine but you can try with virtualbox. You can check https://www.youtube.com/watch?v=3AO8dF0vviQ for some performance improvements tips.
Wine hast been removed from homebrew due to the incompatibility to Macos Catalina
https://discourse.brew.sh/t/issue-with-wine/6188/3
Try using wine64 to run your .exe files after installing wine. The manuals and references don't seem to mention this explicitly.
More Info
I followed the guidance in the wine manual to install using home-brew. After install, I got an error when trying to test the installation like it says in the quickstart.
Install wine-stable using homebrew
brew tap homebrew/cask-versions
brew install --cask --no-quarantine wine-stable
After install, test by opening notepad
wine notepad
zsh: bad CPU type in executable: wine
While uninstalling wine, I noticed one of the linked libraries was called wine64. I immediately reinstalled and tried again using wine64 as the call, as I am using wine on an M1 Mac. This was successful!
You can also use winehelp to get access to more commands that will work with 64bit processor.
Based on https://github.com/Homebrew/homebrew-core/pull/46556#issuecomment-559938873 you can do brew cask install wine-stable on newer version of OS X. And works with recent versions of homebrew since the source version was moved :(
How to install wine on Mac OS Catalina with brew
install homebrew with
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
install xquartz to install wine using brew
brew cask install xquartz
install wine using brew
brew install homebrew/cask-versions/wine-devel
run wine and check the version
wine64 --version
As of Wine 5.0 there is no 32bit support on mac in the official version, but you are able to achieve it via the
Unofficial Wineskin Winery
You can download it from github releases here. And then create a Wineskin with WS11WineCX[64/32]bit19.0.[0/1]. All WS11 versions support Catalina. To use it you also need to turn off the no32exec boot argument. You theoretically can do it by typing:
sudo nvram boot-args="no32exec=0"
into the Terminal while you're logged in but it didn't work out for me, so if you'll have the same problem, reboot into the Recovery mode, in the menubar pick Utilities -> Terminal and type just:
nvram boot-args="no32exec=0"
(without sudo).
Example
To be more exact, to install eg. Steam 32bit, you would:
Install the Unofficiall Wineskin Winery from the provided link
Turn on the 32bit execution boot argument by going into Recovery Mode and entering nvram boot-args="no32exec=0" into the terminal
Open Wineskin, click the '+' sign and scroll down to find the WS11WineCX64bit19.0.1 (the newest version with 64 and 32 bit support, at the time of writing)
Click update/install under the Wrapper Version.
Click Create New Blank Wrapper, name it and click through installation of mono and gecko.
Launch the Wrapper App from Finder. Click Install Software, choose setup executable, and proceed through installation. Then pick the executable from a menu. (In case of steam, Steam.exe)
Note: If you get the "No windows app to open the file"(Like I did) error, click advanced -> configuration and set the Windows EXE to the path to the installer. Then find the place that it has installed in and set that as Windows EXE. Then you can run by clicking Test Run.
Enjoy your windows app, as an .app file!
Hope I helped!

Appium doctor shows error

When I run Appium doctor it shows:
Running iOS Checks
✖ Unknown SW Version Command: Error: Command failed: /bin/sh -c sw_vers -productVersion
/bin/sh: sw_vers: command not found
Appium-Doctor detected problems. Please fix and rerun Appium-Doctor.
Can anyone help let me know what is the wrong here?
running this solved my problem:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
You need to install the command line tools as marked in your message:
✖ Xcode Command Line Tools are NOT installed
From osxDaily:
Launch the Terminal, found in /Applications/Utilities/
Type the following command string:
xcode-select --install
A software update popup window will appear that asks: “The xcode-select command requires the command line developer tools. Would you like to install the tools now?” choose to confirm this by clicking “Install”, then agree to the Terms of Service when requested (feel free to read them thoroughly, we’ll be here)
Wait for the Command Line Tools package download to complete, it’ll be about 130MB and installs fairly quickly depending on your connection speed
The installer goes away on its own when complete, and you can then confirm everything is working by trying to use one of the commands that were just installed, like gcc, git, svn, rebase, make, ld, otool, nm, whatever you want from the list below. Assuming the installation went uninterrupted, the command will execute as expected. This also means you can compile and install things from source code directly without having to use a package manager. Enjoy your new unix command line toolkit!
Have you tried upgrading to the latest Appium version? Are you installing Appium through terminal? My appium-doctor issues were fixed after I installed Appium through terminal and updated the path variables in .bash profile. Appium desktop application is different than one installed through command line.
There are only two possible area which causing that error:
You need to keep all path veriable updated and correct in .bash_profile
You must install
XCode
NodeJS
properly. You must have all permission to access those.
Install all latest version of following things
JDK (Java Development Kit),
Xcode ,
Command Line tools ,
APPIUM For MAC OS
In my case, xcode command line tool isn't set. Simply go to Xcode>Preferences>Locations>Select desired Xcode version in Command Line Tools. OR from terminal follow Chhagan's answer xcode-select -s your path

Running pub install. Please ensure Git is correctly installed. Mac OSX

When putting git: dependency in the pubspec. I get the following error:
'Running pub install' has encountered a problem.
...
...
...
Please ensure Git is correctly installed.
My git is installed at version 1.8.0 that I can access via the terminal on my Mac OS X 10.7.5.
Thank you in advance for any help.
I think the problem is that git's path is loaded to PATH only on terminal start up. Terminal does this by running a file ~/.profile or ~/.bash_profile that often exports the paths to commonly used programs. As a consequence, a GUI app such as the Dart Editor can't 'see' git as it doesn't run this start up file.
There is a way to make certain paths visible to all applications though.
See: https://serverfault.com/questions/16355/how-to-set-global-path-on-os-x/277034
Try creating a file:
/etc/paths.d/git
With the following contents:
/usr/local/git/bin/
If your Git installation is located somewhere else, then use the path accordingly.
I decided to just navigate to the dart project folder and run pub install on the terminal.

Resources