permissions issue when trying to update npm - javascript

I tried to update to the latest version of npm and got this error? Anyone ever have a permission error with npm before? I'm stuck as to how to fix it.
marshalls-MacBook-Air:Desktop marshall$ npm install npm#latest -g
npm WARN checkPermissions Missing write access to /usr/local/Cellar/node/11.9.0/lib/node_modules
npm ERR! path /usr/local/Cellar/node/11.9.0/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/Cellar/node/11.9.0/lib/node_modules'
npm ERR! { [Error: EACCES: permission denied, access '/usr/local/Cellar/node/11.9.0/lib/node_modules']
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, access \'/usr/local/Cellar/node/11.9.0/lib/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/Cellar/node/11.9.0/lib/node_modules' }
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 (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/marshall/.npm/_logs/2019-09-24T17_21_36_708Z-debug.log

you need permission :
sudo npm install npm#latest -g
then put your password

Related

Getting error while trying to install firebase tools

I want to install firebase tools but i am getting error when i run the commad
PS C:\Users\HP\Desktop\FireBlogs> npm i -g firebase-tools
npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path C:\Program Files\nodejs\node_modules\firebase-tools
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\firebase-tools'
npm ERR! [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\firebase-tools'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path: 'C:\\Program Files\\nodejs\\node_modules\\firebase-tools'npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor
or antivirus),
npm ERR! or that you lack permissions to access it.
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! C:\Users\HP\AppData\Local\npm-cache\_logs\2022-02-13T19_07_01_384Z-debug-0.log
I tried few solution but nothing worked for me. I tried installing firebase-tools#v3.17.2 that seemed to work for some people, also tried reinstalling nodejs to lts versin aswell to older versions.

Angular CLI installation error in ubunu - I have get an error when I am trying to run angular CLI command in my ubuntu machine

This error I have got.
I am already install node js and npm in my system.
I also have remove npm cache.
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
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/2020-11-03T18_21_04_293Z-debug.log
~~~
Don't use sudo for this problem. Use sudo the way it is intended to be used in Ubuntu: for each command that requires it, no more. Don't use sudo to run a command unless it needs to be root. For example, most users would only need sudo for installing things.
Have you try, manually change npm's default directory?
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
source ~/.profile
To test your new configuration, install a package globally without using sudo:
npm install -g #angular/cli

nodemon package is not install in nodejs [duplicate]

This question already has answers here:
How to fix npm throwing error without sudo
(39 answers)
Closed 3 years ago.
nodemon package does not successfully install using nodejs. I used npm install -g nodmon. I received the permissions-related error below.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules/nodemon/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! path ../lib/node_modules/nodemon/bin/nodemon.js
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall symlink
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/nodemon/bin/nodemon.js' -> '/usr/bin/nodemon'
npm ERR! { [Error: EACCES: permission denied, symlink '../lib/node_modules/nodemon/bin/nodemon.js' -> '/usr/bin/nodemon']
npm ERR! cause:
npm ERR! { Error: EACCES: permission denied, symlink '../lib/node_modules/nodemon/bin/nodemon.js' -> '/usr/bin/nodemon'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/nodemon/bin/nodemon.js',
npm ERR! dest: '/usr/bin/nodemon' },
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, symlink \'../lib/node_modules/nodemon/bin/nodemon.js\' -> \'/usr/bin/nodemon\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/nodemon/bin/nodemon.js',
npm ERR! dest: '/usr/bin/nodemon' }
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 (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /home/etech7/.npm/_logs/2019-07-02T11_31_52_856Z-debug.log
Try to install it with sudo. It it because you need admin permissions.
sudo npm install -g nodemon
Hope it helps!
This is a permissions issue, as indicated by the error message. You need to fix your permissions or use sudo. Please see: npm throws error without sudo

I'm trying to update my magic mirror using npm, using the following command in terminal: npm install -g npm

pi#raspberrypi:~ $ npm install -g npm
npm WARN checkPermissions Missing write access to /usr/lib/node_modules/npm
npm WARN checkPermissions Missing write access to /usr/lib/node_modules
npm ERR! path /usr/lib/node_modules/npm
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules/npm'
npm ERR! { [Error: EACCES: permission denied, access '/usr/lib/node_modules/npm']
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, access \'/usr/lib/node_modules/npm\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/lib/node_modules/npm' }
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 (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2019-01-13T02_13_34_227Z-debug.log
pi#raspberrypi:~ $
sudo npm install -g npm
Sudo is the key here. May the force be with you.

Node.JS impossible to install ionic

I've recently installed Node.JS for ionic framework. But when i type on the terminal :
npm install -g cordova ionic
I've got this error :
npm ERR! Darwin 14.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cordova" "ionic"
npm ERR! node v4.0.0
npm ERR! npm v2.14.2
npm ERR! path /usr/local/lib/node_modules/cordova
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall rmdir
npm ERR! Error: EACCES: permission denied, rmdir '/usr/local/lib/node_modules/cordova'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, rmdir '/usr/local/lib/node_modules/cordova']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rmdir',
npm ERR! path: '/usr/local/lib/node_modules/cordova' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES: permission denied, rmdir '/usr/local/lib/node_modules/cordova'
npm ERR! error rolling back at Error (native)
npm ERR! error rolling back { [Error: EACCES: permission denied, rmdir '/usr/local/lib/node_modules/cordova']
npm ERR! error rolling back errno: -13,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back syscall: 'rmdir',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/cordova' }
npm ERR! Please include the following file with any support request:
npm ERR! /Users/TARRADOUJL/npm-debug.log
During the installation of Node.JS I need to make sure that /usr/local/bin is in your $PATH.
And when i type
$PATH
The results is :
-bash: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin: No such file or directory
I'm not a "Pro" with the line commands.. but i think i need to change my $PATH for install ionic right ? In this case ? How can i do please?
Try sudo npm install -g cordova. You may have to input your password.

Categories

Resources