diff --git a/ci/build/npm-postinstall.sh b/ci/build/npm-postinstall.sh index b4ff69e66ebc..3c2bcb2dbff0 100755 --- a/ci/build/npm-postinstall.sh +++ b/ci/build/npm-postinstall.sh @@ -76,20 +76,6 @@ main() { exit 1 fi - # Under npm, if we are running as root, we need --unsafe-perm otherwise - # post-install scripts will not have sufficient permissions to do their thing. - if is_root; then - case "${npm_config_user_agent-}" in npm*) - if [ "${npm_config_unsafe_perm-}" != "true" ]; then - echo "Please pass --unsafe-perm to npm to install code-server" - echo "Otherwise post-install scripts will not have permissions to run" - echo "See https://docs.npmjs.com/misc/config#unsafe-perm" - echo "See https://stackoverflow.com/questions/49084929/npm-sudo-global-installation-unsafe-perm" - exit 1 - fi - ;; - esac - fi if ! vscode_install; then echo "You may not have the required dependencies to build the native modules." @@ -110,7 +96,7 @@ install_with_yarn_or_npm() { # end-user we want to keep using whatever package manager is in use. case "${npm_config_user_agent-}" in npm*) - if ! npm install --unsafe-perm --omit=dev; then + if ! npm install --omit=dev; then return 1 fi ;; diff --git a/install.sh b/install.sh index 81c1ce68edcd..28580a871b53 100755 --- a/install.sh +++ b/install.sh @@ -436,7 +436,7 @@ install_npm() { fi echoh "Installing with npm." echoh - "$sh_c" "$NPM_PATH" install -g "code-server@$VERSION" --unsafe-perm + "$sh_c" "$NPM_PATH" install -g "code-server@$VERSION" NPM_BIN_DIR="\$($NPM_PATH bin -g)" echo_npm_postinstall return fi