pizza-cli icon indicating copy to clipboard operation
pizza-cli copied to clipboard

Bug: Installation of Pizza cli on wsl

Open Obasoro opened this issue 1 year ago • 1 comments

Describe the bug

Window 11System settings Ubuntu on wsl

during installation npm i -g pizza was given this error.

npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules'
npm ERR!  [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/usr/local/lib/node_modules'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2025-03-06T22_22_35_600Z-debug-0.log

I had to use a sudo on the command npm i -g pizza to finally have it installed on my local machine.

It is necessary to use sudo?

This is the output of the pizza version

Version: dev
Sha: HEAD
Built at: dev

Steps to reproduce

run npm i -g pizza on wsl ubuntu to install pizza cli

Obasoro avatar Mar 06 '25 22:03 Obasoro

Yes, in your specific scenario, it was necessary to use sudo to install pizza globally because you were trying to install it into a system-protected directory (/usr/local/lib/node_modules).

When you use sudo, you are temporarily elevating your privileges to those of the root user, which has full read and write access to all files and directories on the system. This allows npm to create the necessary directories and files within /usr/local/lib/node_modules.

arnvjshi avatar Jul 24 '25 14:07 arnvjshi