I spent some time figuring the npm
command not found error and it turns out it was the sudo
the cause so no need to use sudo:
command: npmv=$(echo $(npm -v) | head -c 1); if [ "$npmv" -lt "6" ]; then npm i -g npm; else echo "Node.js Docker Team finally decided to include npm v6+ in latest image; you can remove this script now"; fi