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
@random do you know a solution to this?
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
did this help @Crackhog?
After clearing the cache it still doesn’t work
yikes, have you tried global install?
have you tried npx or pnpm?
I don’t know what that means
try pnpm install or npx install
pnpm install:
ERROR This “node_modules” folder was created using the --shamefully-flatten option. You must add this option, or else add the --force option to recreate the “node_modules” folder.
npx install:
install: missing file operand
Try ‘install --help’ for more information.
well, if these do not work then that will mean that you need to run chown- but that needs sudo, so i’ll ping @glitch_support for help
you would run:
chown -R `whoami` ~/.npm
chown -R `whoami` /usr/local/lib/node_modules
sorry I could not help this time!
You can also send [email protected] an email.
Just had a look around, it isn’t possible to chown without sudo
Remove the node_modules folder (rm -rf /rbd/pnpm-volume/app/node_modules
), run refresh
, and wait about 15 seconds. Check the logs to make sure Glitch installed all of your dependencies.