I get below error when npx create-react-app. please help me how to solve this problem.
nodejs version is v16.14.2 and npm version is 8.5.0
To address all issues (including breaking changes), run:
npm audit fix --force
(base) kiranrana#Kirans-MacBook-Pro react-app % npm install -g create-react-app
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/create-react-app
npm ERR! dest /usr/local/lib/node_modules/.create-react-app-DgI96EzL
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/create-react-app' -> '/usr/local/lib/node_modules/.create-react-app-DgI96EzL'
npm ERR! [Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/create-react-app' -> '/usr/local/lib/node_modules/.create-react-app-DgI96EzL'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/usr/local/lib/node_modules/create-react-app',
npm ERR! dest: '/usr/local/lib/node_modules/.create-react-app-DgI96EzL'
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/kiranrana/.npm/_logs/2022-07-12T12_00_07_463Z-debug-0.log
It looks like a permission denied error which could be caused due to incorrect installation of npm/node. Also, I just noticed that you are using kiranrana#Kirans-MacBook-Pro react-app % npm install -g create-react-app which is not recommended. I'd suggest you to use below command.
sudo npx create-react-app .
Related
I was trying to install Surge in order to publish my project but my terminal gave me the following error message:
npm ERR! code EACCES`
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/surge
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/surge'
npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/surge'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/surge'
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.
I am not sure what I need to do. I am the administrator of the computer and the command I ran was npm install -g surge. I am on Mac OS Monterey version 12.4
Any help would be much appreciated.
Thanks
works for me like this:
npm i --package-lock-only
npm cache clean --force
npm audit fix --force
I just ran the command it says to.
npm i --package-lock-only
npm audit fix --force
Anytime it give you permission issues then use sudo at start!
Then it showed me 0 vulnerabilities. Anyway, ran again audit fix and again 0 vulnerabilities.
While I am trying to install the node-sass I am facing error during installation process. Could someone tell how can I resolve this.
npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path C:\Users\deepe\OneDrive\Documents\Yajnaseni\POC\language\node_modules\node-gyp
npm ERR! dest C:\Users\deepe\OneDrive\Documents\Yajnaseni\POC\language\node_modules\.node-gyp-fscmffkd
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\deepe\OneDrive\Documents\Yajnaseni\POC\language\node_modules\node-gyp' -> 'C:\Users\deepe\OneDrive\Documents\Yajnaseni\POC\language\node_modules\.node-gyp-fscmffkd'
npm ERR! [Error: EPERM: operation not permitted, rename 'C:\Users\deepe\OneDrive\Documents\Yajnaseni\POC\language\node_modules\node-gyp' -> 'C:\Users\deepe\OneDrive\Documents\Yajnaseni\POC\language\node_modules\.node-gyp-fscmffkd'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\\Users\\deepe\\OneDrive\\Documents\\Yajnaseni\\POC\\language\\node_modules\\node-gyp',
npm ERR! dest: 'C:\\Users\\deepe\\OneDrive\\Documents\\Yajnaseni\\POC\\language\\node_modules\\.node-gyp-fscmffkd'
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\deepe\AppData\Local\npm-cache\_logs\2020-12-07T07_55_05_230Z-debug.log
have you tried restarting your system
you can also try this
navigate to node modules folder and delete .node-sass
after that execute this command
npm cache verify
npm install
Are you sure you are in the project when you are trying to install node-sass?
I am not sure if it is related. I seem to have problem getting node-sass 5.0.0 to run with reactJs, I am using node-sass#4.14.1.
Have you tried install the version 4.14.1.
npm install node-sass#4.14.1
As mentioned by #Maduekwe Pedro restart the system. Remane or delete the .scss file in the editor and then do
npm cache verify
npm i node-sass
I just changed a new laptop to MacBook air using Catalina. I was successfully installed Node when I tried install Reactjs but it says 'permission denied' to node file as below:
zulfadliazhar#Zulfadlis-MacBook-Air ~ % npm install -g create-react-app
npm WARN checkPermissions Missing write access to
/usr/local/lib/node_modules 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/zulfadliazhar/.npm/_logs/2020-05-15T01_03_00_850Z-debug.log
zulfadliazhar#Zulfadlis-MacBook-Air ~ % create-react-app --version
zsh: command not found: create-react-app
Please assist me.
Thank you
You need the sudo rights to install something in -g (it means global) because it will install it here => /usr/local/lib/node_modules
so you just need to retry like this sudo npm install -g create-react-app
I'm trying to create a new React app but am running into permission errors that I don't understand. I'm pretty new to programming so I don't quite understand what's going on. Below is a copy of my terminal. I am using a Mac with Mojave version 10.14.6. I have Node v10.15.3 installed npm 6.9.0 and npx 6.9.0.
I've had other permission errors before and have used sudo to get around them, but I would really like to know what the root cause of these permission errors is and how to fix it.
Monicas-MacBook-Air:code monica$ npx create-react-app weekly-scheduler
Creating a new React app in /Users/monica/code/weekly-scheduler.
Installing packages. This might take a couple of minutes. Installing
react, react-dom, and react-scripts with cra-template...
npm ERR! path
/Users/monica/.npm/_cacache/index-v5/67/c7/8dd80b7495bd43b4dedc63a0cbc936eed1bb997cd36191f55d47f11693a4 npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall open npm ERR!
Error: EACCES: permission denied, open
'/Users/monica/.npm/_cacache/index-v5/67/c7/8dd80b7495bd43b4dedc63a0cbc936eed1bb997cd36191f55d47f11693a4'
npm ERR! { [Error: EACCES: permission denied, open
'/Users/monica/.npm/_cacache/index-v5/67/c7/8dd80b7495bd43b4dedc63a0cbc936eed1bb997cd36191f55d47f11693a4']
npm ERR! cause: npm ERR! { Error: EACCES: permission denied, open
'/Users/monica/.npm/_cacache/index-v5/67/c7/8dd80b7495bd43b4dedc63a0cbc936eed1bb997cd36191f55d47f11693a4'
npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR!
syscall: 'open', npm ERR! path: npm ERR!
'/Users/monica/.npm/_cacache/index-v5/67/c7/8dd80b7495bd43b4dedc63a0cbc936eed1bb997cd36191f55d47f11693a4'
}, npm ERR! isOperational: true, npm ERR! stack: npm ERR!
'Error: EACCES: permission denied, open
\'/Users/monica/.npm/_cacache/index-v5/67/c7/8dd80b7495bd43b4dedc63a0cbc936eed1bb997cd36191f55d47f11693a4\'',
npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall:
'open', npm ERR! path: npm ERR!
'/Users/monica/.npm/_cacache/index-v5/67/c7/8dd80b7495bd43b4dedc63a0cbc936eed1bb997cd36191f55d47f11693a4',
npm ERR! parent: '#babel/plugin-proposal-unicode-property-regex' }
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/monica/.npm/_logs/2019-12-06T20_36_41_071Z-debug.log
Aborting installation. npm install --save --save-exact --loglevel
error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json Deleting weekly-scheduler/
from /Users/monica/code Done.
I was going through "Modern React with Redux Course" on Udemy, there instructor asked to install NodeJs first and then to install " npm install -g create-react-app", When i tried to run this command , i got an error :-
npm install -g create-react-app
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
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:
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! 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/nitintushir/.npm/_logs/2019-09-20T15_22_12_437Z-debug.log
then i go through a some questions on stackoverflow, where someone suggests to run this command :-
npm cache clean --force
to which i got :
npm WARN using --force I sure hope you know what you are doing.
then i run the
npm install -g create-react-app
command again , but still got the same error , any solution/suggestion ?
It look like an access right error, you should try running your install as root like:
sudo npm install -g create-react-app
You should use nvm to manage your node and npm versions.
https://github.com/nvm-sh/nvm
This would allow you to globally install node modules without any sudo permission
And also you can change your node version anytime you want with nvm CLI