Skip to content

Commit e435d31

Browse files
committed
fix: only require unsafe-perm when installing as root
1 parent ef3f4e8 commit e435d31

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ci/build/npm-postinstall.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ main() {
9292

9393
case "${npm_config_user_agent-}" in npm*)
9494
# We are running under npm.
95-
if [ "${npm_config_unsafe_perm-}" != "true" ]; then
96-
echo "Please pass --unsafe-perm to npm to install code-server"
95+
if [ "$(whoami)" = "root" ] && [ "${npm_config_unsafe_perm-}" != "true" ]; then
96+
echo "Please pass --unsafe-perm to npm to install code-server as root"
9797
echo "Otherwise the postinstall script does not have permissions to run"
9898
echo "See https://docs.npmjs.com/misc/config#unsafe-perm"
9999
echo "See https://stackoverflow.com/questions/49084929/npm-sudo-global-installation-unsafe-perm"

0 commit comments

Comments
 (0)