- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
The error log is informative, and it seems to suggest that if you just create an empty ~/.bash_profile
(or whatever file is appropriate for the shell you are running) then the NVM installer will populate the file with what it needs.
This seems to be confirmed by https://github.com/nvm-sh/nvm/issues/1837#issuecomment-397838000
There would also be value in considering this comment which is AWS-specific https://github.com/nvm-sh/nvm/issues/1837#issuecomment-1345499648
Hello.
I think the cause is that there is no profile data, as the error says.
You can solve the problem by creating an empty profile, or you can install it by setting the user data as shown below.
Therefore, you can install it by changing the user data as shown in the StackOverflow answer below.
https://stackoverflow.com/questions/54415841/nodejs-not-installed-successfully-in-aws-ec2-inside-user-data
#!/bin/bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
source ~/.bashrc
nvm install --lts
node -e "console.log('Running Node.js ' + process.version)"
npm install pm2 -g
version=$(node --version)
echo "export PATH=\$PATH:/.nvm/versions/node/$version/bin/" >> ~/.bashrc
Contenuto pertinente
- AWS UFFICIALEAggiornata un anno fa
- AWS UFFICIALEAggiornata 3 anni fa
- AWS UFFICIALEAggiornata 2 anni fa
- AWS UFFICIALEAggiornata un anno fa