-
-
Notifications
You must be signed in to change notification settings - Fork 577
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 #21
Comments
I encountered a similar problem where Maven (Java Build Tool) was not available within my SSH session but installed on the server:
|
i have this error too. |
@yy921010 try this, fixed my problem script: |
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
npm --help
|
thanks!! |
Fixed it for me as well! Thank you. Do you know why this fixed the problem? |
i think because docker not export environment |
Why is it not loading the users .bashrc correctly? |
npm: command not found sudo ln -s "$NVM_DIR/versions/node/$(nvm version)/bin/node" "/usr/local/bin/node" you can test "sudo npm -v" https://blog.csdn.net/weixin_40599109/article/details/110825357 |
@nathanhannig, maybe script: |
exec bash
pm2 reload app.js |
thanks for the information @vanyauhalin script: |
exec bash \-l
cd ~/project-dir
./deploy.sh it seems what "appleboy/ssh-action" underline do is a sh shell, not a bash shell. it's similar to ssh a@b -t sh |
None of the above worked for me. |
Hello all, I have been facing the same issue. @oshanz pointed out well that when logging through the SSH, the shell is in an interactive mode instead of a login mode. So, some profile information and paths are not loaded. More on this issue here. In any case, I managed to get it working with a here document syntax: script: |
bash -l -c "$(cat <<- EOF
echo "This should work"
EOF
)" There's just one issue, I keep getting this error I think this might also be a (bit hacky) solution for #31. |
This works for me too. |
|
Hey,Gay , I encountered too. So how do you work out? Thank you |
You have to export mvn path, try to use |
Thank you, it is useful; |
I have npm installed on my server, why does the 'npm command not found' error during deployment?
The text was updated successfully, but these errors were encountered: