failed to succeed when attempting to yarn install

For the past few days, I've been facing difficulties installing my dependencies using my package.json due to CPP errors. The installation process fails consistently with npm install.

1 error generated.
make: *** [Release/obj.target/binding/src/binding.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/florian/code/project/inscriptions-v2/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Darwin 21.5.0
gyp ERR! command "/usr/local/bin/node" "/Users/florian/code/project/inscriptions-v2/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/florian/code/project/inscriptions-v2/node_modules/vue-loading-spinner/node_modules/node-sass
gyp ERR! node -v v16.16.0

The dependencies in my package.json file:

"dependencies": {
    "@fortawesome/fontawesome-svg-core": "^1.3.0",
    "@fortawesome/free-solid-svg-icons": "^6.1.1",
    "@fortawesome/vue-fontawesome": "^2.0.6",
    "@lyracom/embedded-form-glue": "^1.0.0",
    "@popperjs/core": "^2.11.5",
    "axios": "^0.21.1",
    "bootstrap": "^5.1.3",
    "core-js": "^3.6.5",
    "css-loader": "^6.7.1",
    "jquery": "^3.6.0",
    "lodash": "^4.17.21",
    "moment": "^2.29.2",
    "popper.js": "^1.16.1",
    "postcss-loader": "^6.2.1",
    "qs": "^6.10.3",
    "register-service-worker": "^1.7.1",
    "sass": "^1.49.11",
    "vue": "^2.6.11",
    "vue-form-wizard": "^0.8.4",
    "vue-head": "^2.2.0",
    "vue-loading-spinner": "^1.0.11",
    "vue-moment": "^4.1.0",
    "vue-progressbar": "^0.7.5",
    "vue-router": "^3.5.3",
    "vue-simple-spinner": "^1.2.10",
    "vue-stepper": "^1.4.2",
    "vue-toastr": "^2.1.2"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.15",
    "@vue/cli-plugin-eslint": "~4.5.15",
    "@vue/cli-plugin-pwa": "~4.5.19",
    "@vue/cli-service": "~4.5.15",
    "babel-eslint": "^10.1.0",
    "eslint": "^6.7.2",
    "eslint-plugin-vue": "^6.2.2",
    "node-sass": "^7.0.1",
    "sass-loader": "^10",
    "vue-template-compiler": "^2.6.11"

I have attempted various solutions including installing different versions of Node and packages, but unfortunately, the issue persists. Strangely, this error occurs only on my macOS machine and not on my WSL Windows.

Answer №1

If you're facing issues, one potential solution is to delete the lock file and node_modules, then reinstall them. If that doesn't work, there are a couple more troubleshooting steps you can try: https://example.com/solve-failed-with-exit-code-2/ or consider installing the Command Line Tools for Xcode if you haven't already.

In my opinion, the problem might be related to the Node version being used.

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

What could be causing the redirection issue in a next.js application?

I recently started working with Next.js and have developed an application using it. On the homepage, I have a timer set for 10 seconds. When the timer hits 0, I want to redirect the user to a feedback page in my "pages" folder. Below is the code I am usin ...

Generate an interactive table: one segment featuring a title or tag - its corresponding rows and columns that change dynamically, followed by another similar segment

I'm attempting to generate a dynamic table with the following structure upon clicking a button (I can't include an image, so here is a sample code to illustrate what I'm aiming for, but I need everything to be dynamic in the actual scenario) ...

Ensure that Angular resolver holds off until all images are loaded

Is there a way to make the resolver wait for images from the API before displaying the page in Angular? Currently, it displays the page first and then attempts to retrieve the post images. @Injectable() export class DataResolverService implements Resolv ...

Transforming the hide/show functionality from JQuery to Vue

I created some hide/show panels using jQuery that I want to implement in Vue. However, when I try to integrate the jQuery functions into Vue, the functionality doesn't seem to work properly. The panels are not hiding/showing as expected. Does anyone ...

AJAX successfully completes, but no response is received

I've been struggling to get the success function in my AJAX call to trigger. I know everything is set up correctly because when I make a request to my API, I can see that it's hitting the URL and the server is responding with an HTTP 200 status. ...

Form with a dropdown menu and a button to duplicate the dropdown menu

In my form, I have a simple setup where user names are listed, and for each user, there is a drop-down box displaying items that can be assigned to them. To facilitate the assignment of multiple items to a user, I want to implement a feature where a "add a ...

What are the steps to keep a web application from closing on Android when the back button is pressed?

I am currently working on a HTML5 web application and packaging it with Cordova (phonegap) 1.7. My goal is to customize the behavior of the Android back button so that instead of closing the application by default, it navigates back using window.history.b ...

Creating a customized design for a q-popup-edit

As I navigate through using Quasar in Vue, I stumbled upon a q-popup-edit that allows me to gather input from the user. Despite my attempts at researching via Google and reading documentation, I have hit a roadblock when it comes to customizing the style o ...

What is the best way to alphabetically arrange an array of names in a JavaScript.map?

I am attempting to alphabetically sort an array of first names using JavaScript map function. Additionally, I aim to remove the "undefined" row from the final results: function contacts_callback(obj) { var contactinfo = obj.contacts .filter( ...

Troubleshooting problems with connecting Express JS and MongoDB

I've written a simple code to connect express js to mongodb, and I've installed both packages. However, I'm encountering an error. Can someone help me troubleshoot this? const express = require("express"); const app = express(); app.listen( ...

What is preventing this setTimeout from triggering?

My experience with Knockout js has left me puzzled, as I seem to be missing a key concept. Despite no error messages, it's challenging for me to pinpoint where exactly the issue lies. All I want is to periodically fetch data and update my table using ...

Creating an asynchronous function using EventEmitter

I am new to node.js and I'm trying to take advantage of asynchronous and event-driven behavior in my code. I used to think that in node, anything involving an Event object would result in asynchronous execution. So I decided to test this theory with ...

What are the steps to reduce the node version?

How can I downgrade my npm version from 16.13.1 to 12.0.1? Any guidance would be greatly appreciated! Thank you in advance. ...

Toggle dark mode in child Layout component with React and Material-UI

Trying to incorporate a dark mode switch in a React+MUI (JS) layout component has been quite challenging. I have been struggling to find a solution using states for this feature. The main goal is to toggle between light and dark modes by utilizing a switch ...

Sending data to a URL using jQuery/Ajax while keeping it hidden from web developers

I own a small online shopping basket where customers can add products. Below is my index.php file: ...<script type="text/javascript" src="function.js"></script> <a title="Add to basket" onclick="add_product_to_cart('apple',&apos ...

Enter a keyword in the search bar to find what you're looking

I am working on a form where users can select their occupation from a list that is stored in a separate .js file. The list includes various occupations like 'AA Patrolman' and 'Abattoir Inspector'. var occupationSelect = "<select id ...

Update the displayed number on the input field as a German-formatted value whenever there is a change in the input, all while maintaining

In German decimal numbers, a decimal comma is used. When formatting, periods are also used for grouping digits. For example, the number 10000.45 would be formatted as 10.000,45. I am looking to create an input field (numeric or text) where users can input ...

Updating the background of a div in HTML through the power of JavaScript

I am having trouble changing the background of a DIV. I believe my code is correct, but it doesn't seem to be working. I suspect the error lies with the URL parameter, as the function works without it. Here is my code: <script language="JavaS ...

Incorporate Scalable Vector Graphics into HTML and manage interactions

There is an SVG file containing various elements such as Circles, Ellipses, Polygons, and polylines, each with its own unique ID. I am looking to add a common JavaScript or jQuery function that can respond to a click event and determine the origin of the c ...

VueJS is unable to identify the variable enclosed within the curly braces

I recently started learning VueJS and I've hit a roadblock. My goal is to display a variable, but for some reason, instead of seeing the product name, all I get is {{product}} Here's the HTML code I'm using: <!DOCTYPE html> <html l ...