[minor] display `chmod` command as well to fix file permissions.

Jordan Harband 2016-05-05 23:58:27 -07:00
parent 1ca2aa648f
commit eb329ae7a9
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
1 changed files with 2 additions and 1 deletions

3
nvm.sh
View File

@ -1963,9 +1963,10 @@ nvm() {
VERSION_PATH="$(nvm_version_path "$VERSION")" VERSION_PATH="$(nvm_version_path "$VERSION")"
if ! nvm_check_file_permissions "$VERSION_PATH"; then if ! nvm_check_file_permissions "$VERSION_PATH"; then
nvm_err 'Cannot uninstall, incorrect permissions on installation folder.' nvm_err 'Cannot uninstall, incorrect permissions on installation folder.'
nvm_err 'This is usually caused by running `npm install -g` as root. Run the following command as root to fix the permissions and then try again.' nvm_err 'This is usually caused by running `npm install -g` as root. Run the following commands as root to fix the permissions and then try again.'
nvm_err nvm_err
nvm_err " chown -R $(whoami) \"$(nvm_sanitize_path "$VERSION_PATH")\"" nvm_err " chown -R $(whoami) \"$(nvm_sanitize_path "$VERSION_PATH")\""
nvm_err " chmod -R u+w \"$(nvm_sanitize_path "$VERSION_PATH")\""
return 1 return 1
fi fi