The npm script failed to build in Docker without any clear errors

I currently have the following Dockerfile setup:

Dockerfile:

FROM node:alpine
WORKDIR /usr/src/app
COPY package*.json ./
COPY src ./
RUN npm  --verbose install
RUN npm run build
EXPOSE 8000

These are the dependencies listed in packages.json

  "dependencies": {
    "autoprefixer-cli": "^1.0.0",
    "copyfiles": "^2.2.0",
    "globstar": "^1.0.0",
    "mkdirp": "^1.0.3",
    "node-sass": "^4.13.1",
    "npm-run-all": "^4.1.5"
  }

Additional Info: The --verbose flag was included to provide more debugging information. While everything builds fine locally, there is an issue when building in Docker where

The command '/bin/sh -c npm  --verbose install' returned a non-zero code.

When simply running npm install, this is the output:

added 269 packages from 289 contributors and audited 814 packages in 6.227s

15 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

npm verb exit [ 0, true ]
npm timing npm Completed in 6589ms
npm info ok
The command '/bin/sh -c npm  --verbose install' returned a non-zero code: 4294967295: failed to shutdown container...

Additional Information: - Attempting with --production or --quiet leads to the same exception - Operating Linux under Windows (WSL) - All software components are up-to-date - Usage of sudo does not resolve the issue

Any suggestions or ideas on how to address this?

Answer №1

After reading a comment on the computer-based reasoning, I realized that the error code wasn't arbitrary as I had initially thought - my mistake.

It has been observed that WSL encounters difficulties when using downloaded binaries in docker, specifically with modules like node-sass. Unfortunately, there is currently no known solution to this issue.

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

Executing a stored procedure using Sequelize in conjunction with an Express API

I've been grappling with this issue which I believe should have a simple solution. My aim is to utilize the Sequelize NPM package to execute a stored procedure that I created. Subsequently, I want to invoke it with a GET request from an express API a ...

The Node.js server continues to stream data even after the client has disconnected

I recently set up a small Node.js + express server with a dummy download method in place: app.get("/download",function(req,res) { res.set('Content-Type', 'application/octet-stream'); res.set('Content-Length', 1000000 ...

Issue encountered during the parsing of an expression by MySQLx in a Node.js application

I recently downloaded the @mysql/xDevApi library from the NPM repository at here and it is currently version 1.0.5 Encountering errors when attempting two different methods:- collection.find("$.name == :name") .bind('name','Test') ...

We're sorry, but Nest is unable to fulfill the dependencies of the movieModel. Kindly ensure that the DatabaseConnection parameter at index [0] is accessible in order for the process

I am facing an issue while using mongoose in Nest.js The error message I received is as follows: Nest can't resolve dependencies of the movieModel (?). Please ensure that the argument DatabaseConnection at index [0] is available in the MongooseModul ...

Monitoring a folder using webpack

Currently, I have webpack set up in my development environment to bundle all of my dependencies. To help concatenate various js files and include them in a script tag within the markup, I am utilizing the webpack-merge-and-include-globally plugin. Althoug ...

What is the process of creating a for loop in FindById and then sending a response with Mongoose?

Is there a way to get all the data in one go after the for loop is completed and store it in the database? The code currently receives user object id values through req.body. If the server receives 3 id values, it should respond with 3 sets of data to th ...

Error encountered: NPM cannot locate mime-db package

After encountering an issue with npm, I was forced to reinstall Nodejs on my Macbook. Despite multiple attempts, I kept receiving the same error message: $ npm Error: Cannot find module 'mime-db' at Function.Module._resolveFilename (module. ...

Combining React, Express, and Nodemailer poses challenges in rendering components and sending emails simultaneously

Looking to utilize client-side routing for my React app and also incorporate Nodemailer for sending emails. However, since Nodemailer cannot be used on the client-side, I need to implement it on the Express server. Here is how the server code looks like: ...

Data modifications in polymer are not being accurately displayed

I need help with hiding/unhiding a UI element using a button in Polymer. Despite having the necessary elements and code set up, it is not working as expected: <button id="runPredictionButton"> <i>Button text</i> </button> <p ...

Having issues with stripe payments in my ReactJS application

I've encountered an issue while attempting to process a credit card payment using Stripe. Here's the code snippet I'm currently working with: import StripeCheckout from "react-stripe-checkout" // import confirmPayment from 'st ...

Messages are not being emitted from the socket

I've been encountering an issue with message transmission from client to server while using React and ExpressJS. When I trigger the sendMessage function on the client side, my intention is to send a message to the server. However, for some reason, the ...

I attempted to implement "cors" in my project, but encountered the error message "Access to XMLHttpRequest has been blocked". What could be causing this issue?

I am facing an issue with my express API where I receive a CORS error message after making a request. Error: Access to XMLHttpRequest at 'http://localhost:9000/api/courses' from origin 'http://localhost:4222' has been blocked by CORS p ...

Utilizing Node and Socket.io to transmit data periodically via websockets from a CSV file

I am relatively new to working with Node.js and Express.js. My goal is to set up a websocket server that can send CSV data at irregular intervals stored within the file itself, line by line. The structure of the CSV looks something like this: [timeout [ms] ...

Guide on incorporating logging and a progress bar into a node.js command-line interface (CLI) application

Situation Overview Within my Node.js program, I currently utilize: node-progress for tracking progress winston for handling logs While the CLI tool shows a progress bar during file compilation, there is an issue with how logs are displayed. Specifically ...

The Express.js server is experiencing difficulty rendering CSS and JS files

Currently, I am in the process of following a tutorial on NODE.js and Express.js via YouTube. However, I have encountered an issue when it comes to rendering the CSS and JS files of a webpage using Express. Surprisingly, the index.html and logo.svg files a ...

The compiled classes for the settings file located at 'E:AccuRideandroidsettings.gradle' could not be loaded from cache. The error message received was: settings_93vy294g361sk31a5mzzi6mpx

Every time I run the command react-native run-android to build my project on a device, it starts the metro server successfully. However, when it comes to installing the app, an error is thrown: FAILURE: Build failed with an exception. Connecting to Daemo ...

Can you explain the distinction between querying a database and making a request to an endpoint?

Recently, I've been diving into learning mongoose but came across a code that left me puzzled. I'm curious as to why we include the async keyword at the beginning of the callback function when querying a database. Isn't it already asynchron ...

Gruntjs Live Reload is actively monitoring for changes, yet fails to refresh the page

Check out my Gruntfile.js here Also, take a look at my package.json here I ran npm install in the main directory of my workspace (using WAMP) and it created a node_modules folder along with several subfolders. After navigating to the directory c:\w ...

An error occurred while trying to access the property 'send' which is undefined

I am currently facing an issue while attempting to send data to the router from an external script. The error message that I receive is TypeError: Cannot read property 'send' of undefined Below is the code snippet: app.js var Cake = require(&a ...

Updating the node startup file with Visual Studio 2015 using NodeJS/Typescript

Encountering a persistent error: Error Code: TS5055 Cannot write file C:/project/dir/server.js' because it would overwrite the input file. Project: TypeScript/JavaScript Virtual Projects Even after renaming my entry filename to nodeserver.js, the ...