how to get automator app to run a yarn command - macos

I'm setting up an automator run shell script to go to a specific folder on users machines and then yarn run dev but when it gets to the yarn part it can't find yarn.
-line 1: yarn: command not found
If I use terminal then yarn will run fine.
I have yarn installed -g which is in my NVM modules.
Here is my script in automator.
cd ~/Documents/myProject
yarn run dev
Also tired this setup:

Like this:
export PATH=$PATH:/Users/me/.nvm/versions/node/v10.16.3/bin
cd ~/Documents/myProject
yarn run dev
The first line tells bash where to look for programs, such as yarn and node.

Related

How to get the exit code from playwright?

I'm running some playwright tests in a pipeline but I'm having problems trying to fail the build when a test fails.
In my pipeline I call a make file that calls a shell script that installs playwright, does some setup, and then runs the command yarn playwright test the script I call always returns an exit code 0 but Playwright returns an exit code 1 if a test fails.
Is it possible for me to get the exit code of Playwright so I can then pass it back up and handle it in my pipeline?
Update:
The line in my makefile that calls the sh script is:
uiTests: node-install node-audit
$(DOCKER_RUN_NODE) bash /app/scripts/playwright.sh
My Playwright.sh script:
#!/usr/bin/env bash
apt-get update
apt-get install -y gnupg2 gnupg1 wget
docker pull mcr.microsoft.com/playwright/python:v1.27.0-focal
yarn install
yarn playwright install
yarn playwright install-deps
yarn run local & yarn run uiTests
rm -rf node_modules
This pulls the dependencies then starts the local instance of the site and runs the tests
yarn run uiTests runs this command "BASE_URL='http://localhost:3000' yarn playwright test"

How do I get yarn 2 to work in my project?

I cd into my project and run yarn set version berry. It creates the .yarnrc.yml with the yarnPath variable. However, if I do run yarn inside the dir it still defaults to the old Yarn. I made a Makefile with commands like ./.yarn/releases/yarn-berry.cjs + install or start to get Yarn 2 to work. What am I doing wrong?
You have .yarnrc or .yarnrc.yml file in your home directory or in some of the parent folders Yarn 1 finds it and Yarn 2.x never gains control, search for it and remove.

git bash does not recognize "environment path" when using package.json scripts

I am trying to yarn start with git bash
"start": "node scripts/start.js",
It always works when using PowerShell or CMD.
But it does not work with git bash.
But when I tried to node scripts/start.js instead yarn start with bash it works!
I tested git bash
yarn -v, node -v, npm -v,
every command works well.
But not work with scripts...
This is the error message
'node' is not recognized as an internal or external command
And i tried to
"startStart": "yarn start",
And this time bash gives me this error message
'yarn ' is not recognized as an internal or external command
I checked my env PATH but all is fine.
--- ENV
VS_CODE
OS : window 10
node : 13.5
npm : 6.13.4
I installed git-bash with git
And all install config is default-standard
Add
I think Git-Bash can find the path when it is alone
I think we should focus on that it can't find path only when it try to trigger package.json scripts
About .profile I didn't know what it is and I never created it.
If it is not default - exist I don't have it.
without to relate to windows specific, npm executes scripts commands (specified in package.json) under the default shell, but it does not perform a login to the shell.
for instance, a bash login (bash --login) in order to use your custom system environment variable.
you can change this by using .npmrc file and set the script-shell. see this answer for the solution.
i hope this is what you suffer from :)

JPS command shows only JPS

I installed hadoop and tried to run it. The terminal shows that everything has been started but when i run jps command it shows only jps. I am new to ubuntu and we need to use for academics can anyone help me run it.
I installed java using sudo apt-get install open-jdk
My usr/lib/jvm directory looks like this
The following are my hadoop configuration files:
Its probably due to the users you are using . I can see start-all.sh with different user and jps with a different user. Run both commands with the same user

Can't run "pod install" in jenkins

My slave machine of Jenkins is Mac 10.8.
Jenkins run job on my slave machine and run shell command of cocoapods below:
pod install
and got error from console output of Jenkins job, please check below:
pod: command not found
I tried to run this command "pod install" in local's terminal of this slave machine and gets succeeds.
could you kindly help on me how to fix this problem?
Thanks.
In my case, my ruby is installed by rvm. I need to load rvm in to find the pod command.
What I did is add this line #!/bin/bash -l in the beginning of the jenkins job.
Ran into the same problem today, but neither of the solutions worked. What did work was changing the install command.
/usr/local/bin/pod install
It seems the user with which Jenkins is running is not getting the path to the pod command that you are able to successfully execute from the Node's command shell. All you need to do is explicitly add the path in PATH variable in your Node's configuration page. To do this, Go to Jenkins > Manage Jenkins > Manage Nodes > Select the Node where your job is running > Click on Configure > Enable Node Properties. Refer the screenshot below:
Just add the path to your pod command in PATH variable. For ex., if the pod command is present in /usr/bin, then in the name field, enter PATH and in the value field, enter /usr/bin/:$PATH
I have not worked on Mac but hopefully, the above command should work there too. If it doesn't work, you can put the following line in $HOME/.bash_profile file of the user with which Jenkins is running: PATH=path_to_pod:$PATH
You can find the path to pod command by typing which pod on command line.
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
/usr/local/bin/pod install
This worked for me

Resources