admin管理员组文章数量:1122846
I install fnm
inside my EC2 instance and uninstalled the old node that was installed before without any node package manager.
The server run correctly with new versions of node and npm.
Before the usage of fnm
, the Yaml File was:
name: Deploy Node.js Application to EC2
on:
push:
branches:
- main
jobs:
deploy:
name: Deploying Node.js Application
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up SSH key
env:
PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
run: |
echo "$PRIVATE_KEY" > private_key
chmod 600 private_key
- name: Deploy to EC2
env:
HOSTNAME: ${{ secrets.hostName}}
USER_NAME: ubuntu
run: |
ssh -o StrictHostKeyChecking=no -i private_key ${USER_NAME}@${HOSTNAME} "cd ~/My_project && git pull origin main && npm install && npm run server"
Now the action failed always with the error bash: line 18: npm: command not found
I tried many ways to update the path to use the correct path to fnm but I got lost (I couldn't find any docs for that , i tried implement as i saw for nvm
but it didnt works)
本文标签: nodejsGithub action to deploy node js using fnmStack Overflow
版权声明:本文标题:node.js - Github action to deploy node js using fnm - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736307125a1933203.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论