Npm Yetkilendirme Hatası ve Çözümü

Nodejs uygulamaları kimi zaman yetkilendirmeden dolayı başınızı yakabilir, bu noktada yapılması gerekenler basit gibi gözükse de yorucu olabiliyor.

Aldığımız hata

npm WARN using --force I sure hope you know what you are doing.npm ERR! code EACCESnpm ERR! syscall mkdirnpm ERR! path /var/www/.npmnpm ERR! errno -13npm ERR! npm ERR! Your cache folder contains root-owned files, due to a bug innpm ERR! previous versions of npm which has since been addressed.npm ERR! npm ERR! To permanently fix this problem, please run:npm ERR! sudo chown -R 33:33 "/var/www/.npm"npm ERR! code EACCESnpm ERR! syscall mkdirnpm ERR! path /var/www/.npmnpm ERR! errno -13npm ERR! npm ERR! Your cache folder contains root-owned files, due to a bug innpm ERR! previous versions of npm which has since been addressed.npm ERR! npm ERR! To permanently fix this problem, please run:npm ERR! sudo chown -R 33:33 "/var/www/.npm"

Bahsi geçen uyarının çözümü log içerisinde belirtilmiş olmakla beraber şu şekilde çözülmektedir,

sudo chown -R www-data:www-data "/var/www/.npm"
sudo chown -R www-data:www-data "/var/www/.npmnpm/"

Sistem Uzmanı, Linux Hacısı, El-Kernel

Yorum yapın