Why I am facing error while installing Nodemon? - npm-install

Last login: Sun Sep 19 13:02:00 on ttys000
navarajgiri#Navarajs-MacBook-Pro ~ % npm i nodemon
added 120 packages, and audited 121 packages in 708ms
11 packages are looking for funding
run npm fund for details
found 0 vulnerabilities
navarajgiri#Navarajs-MacBook-Pro ~ % npm install -g nodemon
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/nodemon
npm ERR! dest /usr/local/lib/node_modules/.nodemon-SfftGed4
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/nodemon' -> '/usr/local/lib/node_modules/.nodemon-SfftGed4'
npm ERR! [Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/nodemon' -> '/usr/local/lib/node_modules/.nodemon-SfftGed4'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/usr/local/lib/node_modules/nodemon',
npm ERR! dest: '/usr/local/lib/node_modules/.nodemon-SfftGed4'
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! /Users/navarajgiri/.npm/_logs/2021-09-19T04_04_27_310Z-debug.log
navarajgiri#Navarajs-MacBook-Pro ~ %

You use npm with the -g (global mode) option which implies system-wide install, and this requires permission (EACCESS) to do so. Either install it in local mode (without -g) possible in a virtuaelenv or run the command as root (via sudo}) as suggested.

Related

I'm trying to download Sanity for this particular project but for some reason on the terminal it's showing this

I'm trying to install Sanity for this project but I'm having trouble installing it and it shows this.
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/#sanity
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/#sanity'
npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/#sanity'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/#sanity'
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! /Users/****/.npm/_logs/2022-08-03T22_03_07_802Z-debug-0.log
zsh: command not found: sanity

npm install -g #sanity/cli commend is not working

I tried to run npm install -g #sanity/cli commend to use Sanity but my return is this..
npm ERR! code EACCES
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/#sanity/cli/bin/sanity
npm ERR! dest /usr/local/bin/sanity
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/#sanity/cli/bin/sanity' -> '/usr/local/bin/sanity'
npm ERR! [Error: EACCES: permission denied, symlink '../lib/node_modules/#sanity/cli/bin/sanity' -> '/usr/local/bin/sanity'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/#sanity/cli/bin/sanity',
npm ERR! dest: '/usr/local/bin/sanity'
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! /Users/kevinsong/.npm/_logs/2022-07-27T17_49_06_969Z-debug-0.log
npm -v 8.13.2
What need to be done to run the npm install -g #sanity/cli?
when I do vi /usr/local/bin, I see this
node*
corepack# --> /usr/local/lib/node_modules/corepack/dist/corepack.js
npm# --> /usr/local/lib/node_modules/npm/bin/npm-cli.js
npx# --> /usr/local/lib/node_modules/npm/bin/npx-cli.js
~
It's because your current user doesn't have the permission
you can check the permission
ls -la /usr/local/lib/node_modules
get the permission for sudo access
sudo chown -R $USER /usr/local/lib/node_modules/
Now try with
sudo npm install -g #sanity/cli
Click HERE for more

VS code setting up development tools ERR! permission

I'm new to using VS code, I'm trying to install Hubspot tools using the npm install -g #hubspot/cli
But when i do i get the following
Thorins-MBP:Practice project thorinphoenix$ npm install -g #hubspot/cli
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/#hubspot
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/#hubspot'
npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/#hubspot'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/#hubspot'
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! /Users/thorinphoenix/.npm/_logs/2022-05-18T13_17_18_580Z-debug-0.log
Thorins-MBP:Practice project thorinphoenix$
I used the best fix on this page and it worked. How to fix EACCES issues with npm install
Enter this into terminal:
sudo chown -R `whoami` ~/.npm
sudo chown -R `whoami` /usr/local/lib/node_modules

Can't install json-server

I am trying to install JSON-Server, but it's not working!
I have used the following command: npm install -g json-server
Here is the error message:
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/json-server
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/json-server'
npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/json-server'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/json-server'
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.
Try to use sudo before command :
sudo npm install -g json-server

How to install expo cli correctly?

I am trying to install expo cli globally but I am getting errors:
OS: Catalina 10.15.4
Node: 14.6
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! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
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! /Users/mac/.npm/_logs/2020-07-25T10_36_46_119Z-debug.log
I install in the Visual Studio terminal, I also tried to install through the console, but the result did not change
When installing some packages globally, you need to do so as a privileged user. On Mac, use sudo to elevate the installation command. E.g. sudo npm install your-package -g