Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

Empowering you to understand your world

Node.js Error Diagnosis: ‘Error: Cannot Find Module ‘express”

Many Node.js code snippets found online make use of the popular Express library, which greatly simplifies the process of writing your own web server, especially if you’re just getting started with Node.js. However, it requires the installation of the express module, which can be done using npm. Failure to do so may result in the following error.

Error: Cannot Find Module ‘express’

You can install Express globally by typing npm install -g express at your command prompt/terminal. You can also install Express in your project’s directory only by typing npm install express in the root of the Node.js project’s director. That way, you’ll have more control over which version you use for each project. For example, you may want to use an earlier version of Express for an older Node.js program that hasn’t yet been updated to work with the latest version.

To do that, you can type npm install express@3, if you want to install the latest version of Express 3 (not the latest version of Express, but the latest version of Express 3).

Subscribe to our newsletter
Get notified when new content is published