The issue of Heroku neglecting to clear or update the node_modules directory for a library hosted on GitHub

Our team is currently managing a node web project on Heroku which relies on a library hosted on GitHub. We frequently update this library on GitHub.

However, when we push the revised node web project to Heroku for deployment, it appears that it does not verify if the GitHub library has been modified.

We are now exploring potential solutions, such as running a command to clear the cache or the node_modules folder on Heroku in order to address this issue.

Thanks, Peter

Answer №1

After some extensive searching, I finally discovered the solution. It is essential to disable the cache via configuration and also clear out the existing cache for previous builds. Additionally, I highly recommend removing the package-lock.json file to resolve any lingering issues.

Check out this link for more information on cache behavior

You can also visit this link for guidance on clearing the build cache

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

When attempting to start a new React project, I encounter an error that is preventing me from moving

Encountering an error while trying to create a React project $ npx create-react-app my-app npm ERR! code ENOENT npm ERR! syscall spawn C:\Program Files\MongoDB\mongosh-2.0.1-win32-x64\bin npm ERR! path C:\Users\SamCro\ ...

Acquiring numerous query string parameters in Express 4

const express = require('express'); const bodyParser = require('body-parser'); const app = express(); const url = require('url'); // middleware to parse application/x-www-form-urlencoded app.use(bodyParser.urlencoded({ extend ...

Firebase encountered a FetchError due to an invalid response body when attempting to fetch data from https://serviceusage.googleapis.com/v1/projects/. The issue was caused by incorrect

While developing a Firebase project locally, everything was running smoothly in emulators. However, after updating Firebase-tools to version 12.4.3, I ran into this error message during deployment: Error: FetchError: Invalid response body while trying to ...

Is there a way to allow an HTML page rendered by node.js to communicate back to its corresponding node.js file?

I am currently in the process of developing a registry system using node.js and HTML. However, I have encountered an issue where my HTML page is rendered by node.js, but when trying to call it back to the node.js file, it appears that the JS file cannot be ...

Setting configuration files in Node.js with npm configuration

I have developed a SAAS application on the Angular/NodeJS/Postgres+MongoDB stack that can establish connections with customer databases, cloud warehouses, S3 buckets, and more to load relevant information. Once I receive connection details from the Angular ...

After running the `npm run build` command in a Svelte (not Svelte Kit) application, the index.html file displays as

When I run the npm run dev server, it displays the default counter app that is built. However, if I build a plain HTML, CSS, and JavaScript project using npm run build in the dist folder, then open the index.html file, it shows a blank page even though the ...

NodeJs Importing a File

Currently working with NodeJS, I have encountered a challenge. Is it possible to require a JavaScript file in Node similar to how we do in browsers? When using the require() method, I noticed that the JavaScript file called does not have access to global v ...

Error on Heroku bash: unable to locate the node command

Has anyone encountered this error when trying to launch a node app on Heroku previously? 2012-10-17T20:28:52+00:00 heroku[web.1]: Starting process with command `node app.js` 2012-10-17T20:28:53+00:00 app[web.1]: bash: node: command not found It appears t ...

Is there a Node ORM that supports application-side joins?

Initially, I experimented with Loopback and found it to be a useful tool. However, one limitation I encountered is that it does not support relationships across multiple REST data services. Instead, Loopback makes a call to the initial data service and pas ...

Managing unique tokens in Express.js: A comprehensive guide

Currently using a node express app, I am aware of 'jsonwebtoken' and 'express-jwt' for token management. However, if the token is not generated by jsonwebtoken, how can I still protect my API using a token? ...

Error: Docker daemon failed to create OCI runtime

I'm in the process of setting up Docker for my Node.js and TypeScript project, but I encountered an error when trying to run docker-compose run --service-ports web. Here's what my composer file looks like: services: web: image: node:alpin ...

issue with array .split() function not being executed correctly on Heroku platform

My Node/Express app deployed on Heroku is causing a discrepancy with the .split() array method. When running it locally versus on Heroku, the arrays produced are entirely different. The issue arises when trying to read a CSV file in the following code sni ...

encountering a problem during the creation of a React application

Hi everyone, I'm encountering an error while trying to create a React app and I'm not sure what the issue is. Can someone help me fix this error and provide guidance on what steps I should take next? Note: my internet connection is working F:& ...

When attempting to display a sub view in Express, a 404 error is encountered

I am currently working with express and jade to display a web page. My intention is to render the page using this format 'http://127.0.0.1:5000/services/landfreight' but I keep encountering a 404 error. router.get('/service/landfreight' ...

React Native: Cautionary Notes during npm installation of <library>

As I embark on creating a fresh react native app with react-navigation, I encounter some concerning warnings each time I execute npm install --save react-navigation. This new app is initiated using react-native init Test, followed by the installation of re ...

Is there a way to set up IIS to host my NodeJS REST API on a unique URL without having to expose any additional ports?

Recently, my organization provided me with a Windows Server running Windows Server 2019 and IIS. I have successfully configured PHP and MySQL to host my website on this server using IIS. However, I have now developed a new service using Node.js that serve ...

The ExpressJS Req.method TypeError occurs when attempting to read the 'method' property of an undefined object

My node express server is throwing an error: Error in index.js. const bodyParser = require('body-parser'), express = require('express'), path = require('path'); const config = require('./config'); con ...

Perform a Node.js GET request following a previous AJAX POST request

Having a major issue with using AJAX... I am not receiving the expected 304 page after a successful AJAX request... here is my code snippet: $.ajax({ url: "/crawling/list", type: "POST", dataType: "json", ca ...

Cloud Firestore trigger fails to activate Cloud function

I am facing an issue with triggering a Cloud Function using the Cloud Firestore trigger. The function is supposed to perform a full export of my sub collection 'reviews' every time a new document is added to it. Despite deploying the function suc ...

Converting a 'Functional Component' to a 'Class Component' in React with Material-UI: A Step-by-Step Guide

Can anyone help me convert this Material-UI example into a Class Component? import React from 'react'; import Button from '@material-ui/core/Button'; import Menu from '@material-ui/core/Menu'; import MenuItem from '@mate ...