Skip to content

Instantly share code, notes, and snippets.

@xtfer
Last active March 25, 2022 22:13
Show Gist options
  • Save xtfer/23cb478906370d68f5acbee6b11a2d3a to your computer and use it in GitHub Desktop.
Save xtfer/23cb478906370d68f5acbee6b11a2d3a to your computer and use it in GitHub Desktop.
Install nvm on Platform.sh
# Statements in this file will be executed (sourced) by the shell in SSH
# sessions, in deploy hooks, in cron jobs, and in the application's runtime
# environment.
# This loads nvm for general usage.
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
# The hooks executed at various points in the lifecycle of the application.
hooks:
# The deploy hook runs after your application has been deployed and started.
build: |
unset NPM_CONFIG_PREFIX
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | dash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm current
nvm install 9.5.0
deploy: |
unset NPM_CONFIG_PREFIX
@xtfer
Copy link
Author

xtfer commented Mar 25, 2022

You should probably ignore this and use what's at https://docs.platform.sh/languages/nodejs/node-version.html. This should work, but it was created before Platform.sh had better node version management.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment