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

npm command not found on github action #1332

Open
bennyh960 opened this issue Nov 21, 2024 · 2 comments
Open

npm command not found on github action #1332

bennyh960 opened this issue Nov 21, 2024 · 2 comments

Comments

@bennyh960
Copy link

fnm is installed in my EC2 instance . i try to deploy but it keep says npm command not found

This is the run commands:

ssh -o StrictHostKeyChecking=no -i private_key ${USER_NAME}@${HOSTNAME}
source ~/.bashrc
cd ~/my_be && git pull origin main
npm install
npm run server
@ehrlich-media
Copy link

This fixed it for me:
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh

@2colours
Copy link

2colours commented Jan 12, 2025

Hi @bennyh960, what fixed it for me was to realize that the .bashrc I had outright checked for the shell being non-interactive and refused to do anything (which is a nonsense tbh). See the accepted answer here.

Afterwards, suddenly I didn't even have to explicitly source .bashrc; apparently that does happen either way.

EDIT: oh right, as for how this helps for Github Actions... I don't know, sorry. xD I use a VPS and Github Actions is only for starting the Ansible playbook. I don't know if it's possible to fool the terminal to think it's an interactive shell, or it's an option to change the .bashrc file manually. But at least it might give you an idea what to do with this fact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants