Ask coding questions

← Back to all posts
Express not working
PixelNinja (319)


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


smuppana060 (22)

Use the command npm install [email protected] in the console

smuppana060 (22)

@smuppana060 And to get bash when the repl is working, go to the terminal and press [CTRL] + C

TheDrone7 (1900)

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 there are two ways: -
1. Modifying the package.json file - Modify the package.json dependecies to match your requirements.
2. Using the package manager - Click on the little cube icon to the left of file manager in your 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 app",
  "dependencies": {

or use the package manager.

Quick tip: also offers an already prepared express boilerplate here

PixelNinja (319)

@TheDrone7 Thanks so much! Have been having problems for days!