How to install npm packages globally in glitch

actually I am following a youtube tutorial to make a zoom clone…(because a newbie)…but when i use the command npm i -g peer it throws an error…but I want to install it globally to tuse peerjs command in shell…Please any way ?

Unfortunately the g switch isn’t supported by Glitch, sorry about that.

1 Like

Is there any other way…I can do that ? Cuz I want use peer for bash command… :frowning:

Just add Peer to the package.json. DO npm init to make one, and hit add package - and type in peer. Then click it and BOOM, peer gets installed on reboot.

1 Like

Can I use peer as a global package like use it in the terminal… I want to use this command peer --port 3001…that’s the reason I want to install it globally…so will this method do it ??

Yes. but you HAVE to use port 3000!
That’s the only open port on glitch.

1 Like

Ok…thanks…actually I am a newbie…Can you please explain me in detail ?..pls

Use peer how you would, but just replace most port entries with 3000, and use peer --port 3000
using the command peer --port 3001 would cause an error

Thank you so much…and sorry for late reply…