When executing `npm install` within a Docker container, the error message `cb() never called!` may be encountered

My project has a rather small package.json file:

{
    "name": "chilldev-web",
    "version": "2.1.0-SNAPSHOT",
    "description": "Client-side build tool for a project.",
    "license": "UNLICENSED",
    "private": true,
    "dependencies": {
        "internal-edge-render": "file:/root/.m2/repository/pl/chilldev/internal/internal-edge-render/0.1.2/internal-edge-render-0.1.2.tar.gz",
        "react": "16.6.1",
        "react-dom": "16.6.1",
        "react-helmet": "5.2.0",
        "director": "1.2.8"
    },
    "devDependencies": {
        ...
    }
}

When I use the local Node/NPM installation (Node v11.0.0, NPM v6.4.1) to perform a fresh installation (

rm -rf node_modules && npm install
), everything works fine.

However, when running a Dockerized task (for example, in a CI pipeline), I encounter a cb() never called! error:

...

Running the task again makes it successful.

...

This is executed in a Docker image with node:11.0.0, but the same issue occurs when installing Node in different images (e.g., using maven:3.5.2-jdk-8).

-edit-

One more detail - to fix the issue with file ownership after Docker execution, I use bindfs:

...

Simply binding instead of using a temporary mount point resolves the issue!

Answer №1

Trying to install a local dependency can cause issues, especially when Docker is involved.

"internal-edge-render": "file:/root/.m2/repository/pl/chilldev/internal/internal-edge-render/0.1.2/internal-edge-render-0.1.2.tar.gz"

The path of the dependency may not be recognized by Docker. You can either install it from npm or mount the directory into docker if possible.

If the latter option is not feasible, finding a solution might be tricky as the logs may not offer much insight in this scenario.

Answer №2

Switching the docker network mode to "host" resolved various problems I was facing.

 docker build . --network host

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

No results returned when using the $lookup aggregation operator

I'm on the hunt for the most loved recipes. I possess 2 pertinent collections: recipes and favoriterecipes. Points to ponder: I have verified the names and ids of the collections. In the database itself, the _recipe field in favoriterecipes is of t ...

Solution: How to fix the error: Invalid component type, 'Draggable' cannot be used with JSX in react-draggable

I encountered an error while working on this Next.js React project Type error: 'Draggable' cannot be used as a JSX component. Its instance type 'Draggable' is not a valid JSX element. The types returned by 'render()&apo ...

Tips for adding an array of objects into a MariaDB database

My MariaDB table is quite simple, consisting of 3 columns: DT as the primary key Savings kpd https://i.stack.imgur.com/8p9YA.png I am looking to efficiently insert a large array of objects into the table at once. Here is a snippet of how the data looks: ...

What could be causing the delay in response times from these unpredictable APIs within the Express server?

We are currently experiencing performance issues with our Express.js server and MongoDB database. Randomly, some API requests are taking too long to respond or timing out throughout the day. Our application is in production, hosted on two AWS instances wit ...

Navigating race conditions within Node.js++]= can be challenging, but there are strategies

In the process of developing a MERN full stack application, I encountered a scenario where the frontend initiates an api call to "/createDeckOfCards" on my NodeJS backend. The main objective is to generate a new deck of cards upon clicking a button and the ...

Angular 6: Dealing with Type Errors in the HttpClient Request

I am encountering issues with my services. I am attempting to retrieve a list of media files (generated by NodeJS, which generates a JSON file containing all media items). Although I can successfully fetch the data, I am facing an error stating "Property & ...

How to efficiently initialize a Next.js app with Phusion Passenger while triggering the production build using a specific file?

In most cases, a Next.js application is launched by using the command npm run start after compiling it with npm run build. I am unable to start it using a command because my web server stack (Phusion Passenger) requires a specific startup script. https:// ...

Encountering the error message "Module not found: '@babel/runtime/helpers/builtin/objectSpread'" after upgrading to Meteor version 1.6.1.1

After updating my meteor project to Meteor 1.6.1.1, I encountered the following error message: => Exited with code: 1 W20180403-15:33:17.531(2)? (STDERR) E:\Personnal folders\quicktext5\.meteor\local\build\programs&bsol ...

Querying CosmosDB with Azure Function using NodeJS

Here's a simple question: I have the following function in my index.js file. const databaseId = config.database.id; const collectionId = config.collection.id; const client = new CosmosClient({ endpoint: CosmosDBName, auth: { masterKey: CosmosDBKey } ...

Can you identify any issues with this NodeJs multer code for uploading files?

Hello there! I have embarked on a journey to master Node's multer library, known for its ability to facilitate file uploads through API calls. To kick things off, I've set up a basic express application that is currently running and listening on ...

Tips for passing a variable from one function to another file in Node.js

Struggling to transfer a value from a function in test1.js to a variable in test2.js. Both files, test.js and test2.js, are involved but the communication seems to be failing. ...

Having trouble launching my node application on port 80 on Ubuntu 16.04

Trying to run my node app on port 80 in Ubuntu 16.04 is proving to be a challenge. Despite the fact that the port is not in use, when attempting to start my app with npm start, an error message stating "Port already in use" is displayed. According to infor ...

Is there a way to bypass the requirement of having at least 20 tokens for text classification using the Google NLP API?

Is there a solution to bypass the minimum token requirement for Google's NLP API text classification method? I am attempting to input a short, simple sentence like "I can't wait for the presidential debates" but it keeps showing an error message: ...

Concerns regarding the implementation of enums in Nest JS originating from the package

I'm struggling with using TypeScript enums in my Nest JS Application. Our project is set up as a monorepo (npm workspace) with multiple packages and apps. One of the packages includes shared types for both our frontend (Next JS) and backend. While th ...

In Node.js with Express, ensure variable scope is restricted to the current request

In my express application, I have a feature that makes POST requests and calls different APIs. What I want to achieve is sending an email when any of the API requests result in an error. Here's a simplified version of what I'm working on: In the ...

Using Node.js to execute JavaScript with imported modules via the command line

Having limited experience with running JavaScript from the command line, I am facing a situation where I need to utilize an NPM package for controlling a Panasonic AC unit, which includes a wrapper for their unofficial API. My objective is to create a sim ...

Encountering an unexpected identifier 'str' while working on a new React Native project

Recently, I set up a new react-native project on my Windows 10 system by following these steps: npm install -g react-native react-native init myproject cd myproject react-native run-android The setup involves having Android Studio installed and running a ...

npm performs a GET request to retrieve downloaded packages for every installation process

Whenever I attempt to add a node package utilizing npm, the subsequent commands are executed: npm http 304 http://registry.npmjs.org/cryptiles npm http 200 http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.10.tgz npm http 200 http://registry ...

Encountering a "code redeemed error" when utilizing Google OAuth

Currently, I am working on a project that involves user login through a Google account on localhost. The Google signup functionality has been successfully implemented. However, upon logging in from my account, I encountered the following error message: To ...

Difficulty with Docker-compose when packaging Meteor application (npm issues)

Looking for assistance with a persistent npm error while attempting to bundle my Meteor app using docker-compose. Despite all files being clearly visible in the app directory, including package.json, I am encountering many errors during the final build ste ...