composer root 경고메시지 해제

1 개요[ | ]

Do not run Composer as root/super user! See https://getcomposer.org/root for details
Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted
How to set COMPOSER_ALLOW_SUPERUSER
root 경고메시지 해제

2 문제상황[ | ]

composer v2.6
root@zetawiki:~# composer -V
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
Composer version 2.6.6 2023-12-08 18:32:26
composer v1.1
root@zetawiki:~# composer -V
Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted
Composer version 1.1.1 2016-05-17 12:25:44

3 임시 적용[ | ]

root@zetawiki:~# export COMPOSER_ALLOW_SUPERUSER=1
root@zetawiki:~# env | grep COMPOSER_ALLOW_SUPERUSER
COMPOSER_ALLOW_SUPERUSER=1
root@zetawiki:~# composer -V
Composer version 1.1.1 2016-05-17 12:25:44
→ 현재 세션에 적용됨

4 영구 적용[ | ]

root@zetawiki:~# echo "export COMPOSER_ALLOW_SUPERUSER=1" >> ~/.bashrc
root@zetawiki:~# cat ~/.bashrc | grep export
export LANG=en_US.UTF-8
export COMPOSER_ALLOW_SUPERUSER=1
.bashrc에 등록하면 다음번 SSH 접속시부터 계속 적용됨

5 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}