node.jsnpmnpm-installnode-gyp

pm error sh: node-gyp-build: command not found


rakibulb@Rakibuls-MacBook-Air advanced-todolist % npm install
npm error code 127
npm error path /Users/rakibulb/Documents/ComputerScience/Portfolio Projects/HTML:CSS:JS/advanced-todolist/node_modules/bufferutil
npm error command failed
npm error command sh -c node-gyp-build
npm error sh: node-gyp-build: command not found
npm error A complete log of this run can be found in: /Users/rakibulb/.npm/_logs/2024-05-20T15_36_50_210Z-debug-0.log

I have just cloned a repo that i was using on my desktop pc, i cloned it to my MacOS, and when i tried doing npm install i get that error, i tried looking up at other stack overflow posts but they did not help.

I tried uninstalling my Node.js and then re installing, i also updated my npm to the latest version, but nothing helped.

Here is my package.json

{
  "name": "todo-enhanced",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@hookform/resolvers": "^3.3.4",
    "@next-auth/prisma-adapter": "^1.0.7",
    "@prisma/client": "^5.13.0",
    "@radix-ui/react-dialog": "^1.0.5",
    "@radix-ui/react-label": "^2.0.2",
    "@radix-ui/react-select": "^2.0.0",
    "@radix-ui/react-slot": "^1.0.2",
    "@vercel/postgres": "^0.8.0",
    "bcrypt": "^5.1.1",
    "class-variance-authority": "^0.7.0",
    "clsx": "^2.1.1",
    "lucide-react": "^0.378.0",
    "next": "14.2.3",
    "next-auth": "^4.24.7",
    "react": "^18",
    "react-dom": "^18",
    "react-hook-form": "^7.51.4",
    "react-hot-toast": "^2.4.1",
    "tailwind-merge": "^2.3.0",
    "tailwindcss-animate": "^1.0.7",
    "zod": "^3.23.8"
  },
  "devDependencies": {
    "@types/bcrypt": "^5.0.2",
    "@types/node": "^20",
    "@types/react": "^18",
    "@types/react-dom": "^18",
    "eslint": "^8",
    "eslint-config-next": "14.2.3",
    "postcss": "^8",
    "prisma": "^5.13.0",
    "tailwindcss": "^3.4.1",
    "typescript": "^5"
  }
}


Solution

  • Seems like you're missing node-gyp-build itself.

    Try npm install -g node-gyp-build then retry your npm install.