代码之家  ›  专栏  ›  技术社区  ›  RakibulB

pm错误sh:node-gyp-build:找不到命令

  •  0
  • RakibulB  · 技术社区  · 2 年前
    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
    

    我刚刚克隆了一个我在台式电脑上使用的repo,我将其克隆到我的MacOS中,当我尝试这样做时 npm install 我得到了那个错误,我试着查找其他堆栈溢出的帖子,但它们没有帮助。

    我尝试卸载我的 Node.js 然后重新安装,我还更新了 npm 到最新版本,但没有任何帮助。

    这是我的 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"
      }
    }
    
    
    1 回复  |  直到 2 年前
        1
  •  1
  •   XERAEN    2 年前

    你好像失踪了 node-gyp-build 它本身

    尝试 npm install -g node-gyp-build 然后重试 npm install .

    推荐文章