-1

Can anyone help me with this npm ERROR.

npm install sfdx-cli --global
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=14.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
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/ameer/.npm/_logs/2023-02-16T16_15_52_419Z-debug-0.log

I am getting this error while installing the sfdx cli in my ubuntu 22.04. I have already installed nodejs and npm even though I didn't understand what the problem is.

2
  • Your user account does not have write permissions to /usr/local/lib/node_modules. Try sudo npm install sfdx-cli --global if you have access and enough privileges to sudo.
    – identigral
    Commented Feb 16, 2023 at 16:42
  • @identigral using npm in sudo mode is not needed and not recommended medium.com/@ExplosionPills/dont-use-sudo-with-npm-5711d2726aa3
    – Freddy
    Commented Mar 15, 2023 at 9:06

1 Answer 1

0

NPM is not correctly configured to run in none-sudo mode.

NPM should not require sudo. Running npm with sudo is highly discouraged.

This is the question you're looking for. I would also recommend using NVM.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .