3

I have a Vue.js app and I am trying to setup it in my local Mac machine. But when I use npm install to install the dependanceis, I am getting the following error

npm ERR! 1 error generated.
npm ERR! make: *** [Release/obj.target/binding/src/binding.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/Users/username/Desktop/Work/Projects/project_name/node_modules/node-gyp/lib/build.js:262:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 21.6.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/Users/username/Desktop/Work/Projects/project_name/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /Users/username/Desktop/Work/Projects/project_name/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.0.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

At first it was showing an error that says python2 was not found. Now I have installed and switched to Python2 and now this error is coming. I have tried almost everything but still the issue is not fixed. Please find my environment details below:

  • OS - MacOS Monterey
  • Node - 16.0.0
  • npm - 7.10.0
  • Python - 2.7.18

and my package.json file is as follows:

{
  "name": "my-app-client",
  "dependencies": {
    "@gtm-support/vue2-gtm": "^1.3.0",
    "axios": "^0.18.1",
    "cross-env": "^5.2.0",
    "cryptr": "^4.0.1",
    "es6-promise": "^4.2.4",
    "https": "^1.0.0",
    "underscore": "^1.9.1",
    "vue": "^2.5.2",
    "vue-cookies": "^1.5.4",
    "vue-i18n": "^8.0.0",
    "vue-recaptcha": "^1.1.1",
    "vue-router": "^3.0.1",
    "vue-scrollto": "^2.17.1",
    "vue-session": "^1.0.0",
    "vuex": "^3.0.1"
  },
  "devDependencies": {
    "autoprefixer": "^7.1.2",
    "babel-core": "^6.22.1",
    "babel-eslint": "^7.2.3",
    "babel-helper-vue-jsx-merge-props": "^2.0.3",
    "babel-loader": "^7.1.1",
    "babel-plugin-syntax-jsx": "^6.18.0",
    "babel-plugin-transform-runtime": "^6.22.0",
    "babel-plugin-transform-vue-jsx": "^3.5.0",
    "babel-preset-env": "^1.3.2",
    "babel-preset-stage-2": "^6.22.0",
    "chalk": "^2.0.1",
    "copy-webpack-plugin": "^4.0.1",
    "css-loader": "^0.28.0",
    "dotenv-webpack": "^4.0.0",
    "eslint": "^4.15.0",
    "eslint-config-standard": "^10.2.1",
    "eslint-friendly-formatter": "^3.0.0",
    "eslint-loader": "^1.7.1",
    "eslint-plugin-import": "^2.7.0",
    "eslint-plugin-node": "^5.2.0",
    "eslint-plugin-promise": "^3.4.0",
    "eslint-plugin-standard": "^3.0.1",
    "eslint-plugin-vue": "^4.0.0",
    "eventsource-polyfill": "^0.9.6",
    "extract-text-webpack-plugin": "^3.0.0",
    "file-loader": "^1.1.4",
    "friendly-errors-webpack-plugin": "^1.6.1",
    "html-webpack-plugin": "^2.30.1",
    "less": "^3.0.1",
    "less-loader": "~4.1.0",
    "node-notifier": "^5.1.2",
    "node-sass": "^4.7.2",
    "nodemon": "^1.15.1",
    "optimize-css-assets-webpack-plugin": "^3.2.0",
    "ora": "^1.2.0",
    "portfinder": "^1.0.13",
    "postcss-import": "^11.0.0",
    "postcss-loader": "^2.0.8",
    "postcss-url": "^7.2.1",
    "rimraf": "^2.6.0",
    "sass-loader": "^6.0.7",
    "semver": "^5.3.0",
    "shelljs": "^0.7.6",
    "uglifyjs-webpack-plugin": "^1.1.1",
    "url-loader": "^0.5.8",
    "vue-loader": "^13.3.0",
    "vue-style-loader": "^3.0.1",
    "vue-template-compiler": "^2.5.2",
    "webpack": "^3.6.0",
    "webpack-bundle-analyzer": "^2.9.0",
    "webpack-dev-server": "^2.9.1",
    "webpack-hot-middleware": "^2.22.3",
    "webpack-merge": "^4.1.0"
  },
  "engines": {
    "node": ">= 8.0.0",
    "npm": ">= 3.0.0"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 8"
  ]
}

This is a legacy codebase and sometimes, the package versions were too old. IS there any work around to fix this issue and so I can run the application on local ?

1

1 Answer 1

4

If you are using nodejs 16.x. try to install sass instead of node-sass.

npm uninstall node-sass
npm install sass --save
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.