Page MenuHomePhabricator

"fresh-node: command not found" in Git Bash on Windows
Closed, ResolvedPublic

Description

hp@Umang MINGW64 ~/OneDrive/Desktop/mediawiki/mediawiki (master)
$ shasum -a 256 /C/Users/hp/fresh-node
1bd70d4235b05d411921f685e4a66784cf066278e8dd3207d356159aca986bb4 */C/Users/hp/fresh-node

hp@Umang MINGW64 ~/OneDrive/Desktop/mediawiki/mediawiki (master)
$ fresh-node
bash: fresh-node: command not found
hp@Umang MINGW64 ~/OneDrive/Desktop/mediawiki/mediawiki (master)
$ fresh-node -env -net
bash: fresh-node: command not found

Event Timeline

@Iamumangg can you include all the steps you followed up till this point? Include other information like your node version, npm version, OS, etc as well.

Vidhi-Mody triaged this task as Medium priority.Apr 2 2021, 8:09 AM
Vidhi-Mody added a project: User-Vidhi-Mody.
Vidhi-Mody moved this task from Backlog to In Progress on the User-Vidhi-Mody board.

hey @Vidhi-Mody i had already set up mediawiki repo atleast 10 days back with @Soda and installed docker setup in it . but now to run selenium test i need docker setup ,so instead of using core repo and installing whole setup again .i just used my old repo cause its same .

the steps that i followed :

then i cloned the repo of fresh and run the command :

bash -c 'curl -fsS https://gerrit.wikimedia.org/g/fresh/+/21.01.1/bin/fresh-node10?format=TEXT \

base64 --decode > /C/Users/hp/fresh-node \

&& echo "1bd70d4235b05d411921f685e4a66784cf066278e8dd3207d356159aca986bb4 /C/Users/hp/fresh-node" | shasum -a 256 -c \
&& chmod +x /C/Users/hp/fresh-node \
&& echo -e "\n\xf0\x9f\x8c\xb1\x20Fresh\x20is\x20ready\x21\n"||(echo -e "\xe2\x9d\x8c";false)'

in this command i have changed the path because it showing error with /usr/local/bin ..
and it perfectly executed and shows : fresh is ready

but when i go to my repo and run fresh-node it shows error .. u can see in the description

P.S : i use windows

node -v : v14.16.0
npm -v :  6.14.11 
i use gitbash and powershell

If you have Mediawiki running try running the tests without fresh. They should work.

export MW_SERVER=http://localhost:8080
export MW_SCRIPT_PATH=/w
export MEDIAWIKI_USER=Admin
export MEDIAWIKI_PASSWORD=dockerpass
npm run selenium-test

If you still face difficulty create a new task following https://www.mediawiki.org/wiki/How_to_report_a_bug

(Furthermore, please use the preview function below the text field before submitting a comment, to make sure that comments are readable - thanks!)

@Iamumangg The error in question is due to the fact that you are probably running the script inside Git Bash (which has some weird quirks that may be causing issues with the bash script). If you want to do stuff using fresh-node on Windows, try using either a Linux VM or WSL2.

Yes @Soda & @Vidhi-Mody trying running on linux . I'll update u further if i face any error

ok @Aklapper I'll keep in mind next time . - Thanks

On Linux and macOS, the /usr/local/bin/ directory is included in the search path for commands (known as the "PATH" variable). This means that when you place a program in that directory, you can run that program by using its name, like fresh-node.

If you install fresh-node at /C/Users/hp/fresh-node instead, then you need to use its full name like /C/Users/hp/fresh-node when you run the program. For example, this might work:

hp@Umang MINGW64 ~/OneDrive/Desktop/mediawiki/mediawiki (master)
$ /C/Users/hp/fresh-node -env -net

If you use Windows, consider using WSL: Windows Subsystem for Linux (nstead of Powershell or Git Bash). The WSL is a Linux-compatible environment where /usr/local/bin/ is also supported, I think.

https://docs.docker.com/docker-for-windows/wsl/

Aklapper renamed this task from prob. regarding fresh installation. to "fresh-node: command not found" in Git Bash on Windows.Apr 20 2021, 5:39 AM