I installed the netlify-cli package globally using npm install netlify-cli -g , the installation completed. After that I ran netlify command and got this error
Error: EACCES: permission denied, open '/Users/{USER_FOLDER}/Library/Preferences/netlify/config.json.2846113261' You don't have access to this file.
To Reproduce
Steps to reproduce the behavior:
Run npm install netlify-cli -g
Installation succeed
Run netlify
Gets the error about not having access to config.json file
hi there, thats definitely frustrating! does your terminal instance have suffcient privileges for this to run properly? Are you running it as an administrator if you are on windows?
Firstly, sudo npm install -g netlify-cli command produced an empty ānetlify folderā.
So, thereās no config.json file in my directory. This time I ran the command the ā/Users/aminarahmanā directory. Please help me. I also tried to run the installation command from my project directory.
Here is another attempt. I uninstalled first and then tried npm install -g netlify-cli and sudo npm install -g netlify-cli. Here are the errors I get. The āconfig.jsonā file is empty.
Hello, Luke, I saw those and tried the first one earlier. I somehow managed to install using sudo npm install -g netlify-cli once, where I got the empty āconfig.jsonā file. Here in the screenshot, I deleted my current ānetlifyā directory as said in the first link and you can see the rest.
I also tried to manually change the permission (Read&Write for all) as said in the second link.
Then I tried running netlify. But got this
" Error: EACCES: permission denied, open ā/Users/aminarahman/Library/Preferences/netlify/config.jsonā
You donāt have access to this file."
Maybe I donāt understand the instructions given in these solutions. I am trying to follow everything suggested in those links.
Iād suggest that your installation as root caused the problem, and youāll need to keep cleaning up from that. This is not a netlify problem; this is something you broke and need to fix, that we canāt directly advise on.
What I can tell is that according to the error message, youāll likely
need to at least remove the file that the error complains about you not having permissions on: /Users/aminarahman/Library/Preferences/netlify/config.json
Thank you for the hint. I had to uninstall Node. In my case, then installed NVM via Homebrew, then installed Node again. This solved the issue. This one link helped me to solve my problem eventually.
hi guys I have the same permission denied problem after trying sudo/npm/homebrew npm install -g netlify-cliā¦
I even try manually change the permission of netlify file in /Users/Lizzie/Library/Preferences/netlify/`. still not workingā¦
I eventually find the solution and it works for me:
step2: make sure you donāt have the netlify folder yet.(delete the one you have downloaded)
go for all steps ( if you cant install source ~./profile , then you could just jump to NPM_CONFIG_PREFIX=~/.npm-global`