Hello,
I seem to have lost my permissions for my glitch project console. Whenever I try to cd into some node modules or try to use commands like npm install, I get an error, telling me that I don’t have permissions and or that my access is denied.
How can I fix this issue?
Thank you for taking your time.
Can you send a screenshot of the error?
Glitch doesn’t allow users to execute commands at the root level (ie. you cant use administrator commands or npm packages that need administrator privileges.) I hope this answered your question!
Yesterday, it worked fine though
Also, could you please tell me how I should install packages instead? Just adding the dependency in package.json somehow doesn’t work for me.
What package would you like to install?
My app needs these packages. They were all installed and worked properly the day before, but suddenly, they were gone (require() says that it can’t find the module)
Hmm that’s odd. If you didn’t make too many changes today you could try rewinding your project.
How do I rewind it?
(Thank you so much for helping me by the way)
Type download
your projects search bar. A box should appear and you will want to move the little line back a bit.
“Download Project” pops up when I search for download, but I don’t know where the line is. Clicking on Download Project just downloads a tgz file
Oops! I meant to say rewind
.
I rewinded the project to the time where it still worked, but it didn’t fix it
try
npm install --unsafe-perm=true --allow-root
or if that doesn’t work:
npm init
follow these steps to allow global installation:
How to install npm packages globally (guide)
hope this helps
The first command gave me the same error as above, and the second one didn’t help.
I’m currently following the guide, but have a question. Where is the .bashrc/.zshrc file?
the .bashrc is created by you. i reccomend .bash_profile if you want it read every session
try:
npm cache clean --force --unsafe-perm