Dijiflex
Dijiflex

Reputation: 593

How I i solve Build Failed on Azure Devops Pipeline when building a node application

I have been studying azure devops in the past weeek and i have been trying to deoploy my first node app on azure but i keep running on an error of build failed. and the error is Error Cannot find module './routes/hostelRoutes' so i have checked and confirmed that the module is available because everything runs on my local machine. Below is a pic where i get the error

enter image description here enter image description here

Upvotes: 1

Views: 1133

Answers (1)

Kevin Lu-MSFT
Kevin Lu-MSFT

Reputation: 35194

According to the error message:

Error Cannot find module './routes/hostelRoutes'

The ‘node_modules’ folder could have some issues.

You could try to remove the directory ‘/node_modules/’ and re-install the folder.

Please refer to the following command line script about removing and re-installing.

cd  Project_folder
rm -rf node_modules
npm install

You could check this ticket How do I resolve “Cannot find module” error using Node.js? for some information

Upvotes: 1

Related Questions