Ask coding questions

← Back to all posts
How to install new packages
JohnS4

I know how to install packages through repls ways, in the side bar. And i also know how to install packages in the shell. But in the shell, sometimes I want to install a package that adds a new command to the terminal, like the package Slappey

I normally do npm i slappy and it is done. then to run the command i do slappey. it says it is not defined. I also know you have to do npm i slappey -g but it wont let me do that for some reason. any help?

Voters
AuthenticGaming
JohnS4
Comments
hotnewtop
StringentDev

@JohnS4 try npx slappy as it will install then run the packages.

PattanAhmed

@JohnS4 Hi,
Hit Ctrl + Shift + S to login to your Repl's Shell.
You will notice a new window under the console
Type there:-

That will install the package manually.
If you want to install it automatically then, just import or use that package, it will automatically install the required files needed.

That's it
Thanks!

Hope this helps

CodeLongAndPros

install-pkg foo for the deb
npm i foo for Node
pip install foo for Py
wget && tar xzvf && cd && ./configure && make install for source

RohilPatel

Hey! I know why!

  1. Don't worry about using npm, just require the module and boom it installs
  2. Repl.it won't let you install things globally, so don't use the console in the first place!

Mark as correct by clicking the check mark if this helps in any way!

Coder100

Hi! Just install it normally:

but, in your package.json, add:

Replace [your command here] with whatever is needed.

Then, in your .replit:

ironblockhd

replit automatically installs packages when you require() them in your code, but you can do CTRL+SHIFT+S to enter a shell where you can do that