The express example in nodejs is not working and is having an error where it can't find express module. Any ideas? This one has had me stuck for a little while now
express is a node.js module that has to be first installed. Locally you would be able to accomplish this using package managers like npm or yarn but on repl.it there are two ways: - 1. Modifying thepackage.jsonfile - Modify the package.json dependecies to match your requirements. 2. Using the repl.it package manager - Click on the little cube icon to the left of repl.it file manager in your repl.it editor and search for the package you want to install and then click on install.
In your case, the required module is express for which you can modify your package.json to look something like this: -
{
"name": "promo",
"version": "0.0.1",
"description": "my second socket.io app",
"dependencies": {
"express":"latest"
}
}
or use the package manager.
Quick tip: Repl.it also offers an already prepared express boilerplate here
Hi,
The express example in nodejs is not working and is having an error where it can't find express module. Any ideas? This one has had me stuck for a little while now
Thanks!
express
is a node.js module that has to be first installed. Locally you would be able to accomplish this using package managers likenpm
oryarn
but on repl.it there are two ways: -1. Modifying the
package.json
file - Modify thepackage.json
dependecies to match your requirements.2. Using the repl.it package manager - Click on the little cube icon to the left of repl.it file manager in your repl.it editor and search for the package you want to install and then click on
install
.In your case, the required module is
express
for which you can modify your package.json to look something like this: -or use the package manager.
@TheDrone7 Thanks so much! Have been having problems for days!
@RossJames You're welcome.