Skip to content
← Back to Community
How to install new packages
Profile icon

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?

Profile icon
Profile icon
Profile icon

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

npm i slappy

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

Hope this helps

Profile icon

The package was slappy

Profile icon

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

Profile icon

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

Profile icon

Hey! I know why!

  1. Don't worry about using npm, just require the module and boom it installs
  2. 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!

Profile icon

Hi! Just install it normally:

npm i slappy

but, in your package.json, add:

{ /* "title": "...", ... */ "scripts": { /* "test": "..." */ "start": "[your command here]" } }

Replace [your command here] with whatever is needed.

Then, in your .replit:

run = "npm run start"
Profile icon

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