【问题标题】:sh: node-gyp-build: command not foundsh:node-gyp-build:找不到命令
【发布时间】:2023-01-12 06:03:34
【问题描述】:

npm install 失败并显示以下消息。我尝试删除 node_modules 并重新安装,但它没有用。

15104 错误命令 sh -c node-gyp-build

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

有谁知道如何解决这个问题?

npm install --verbose的错误日志:

npm ERR! code 127
npm ERR! path /Users/johnnycheng/Documents/React Projects/blockchain:fintech/coin-web-test2/node_modules/utf-8-validate
npm ERR! command failed
npm ERR! command sh -c node-gyp-build
npm ERR! sh: node-gyp-build: command not found
npm verb exit 127
npm timing npm Completed in 30755ms
npm verb unfinished npm timer reify 1650620386080
npm verb unfinished npm timer reify:build 1650620407577
npm verb unfinished npm timer build 1650620407582
npm verb unfinished npm timer build:deps 1650620407583
npm verb unfinished npm timer build:run:install 1650620407669
npm verb unfinished npm timer build:run:install:node_modules/bufferutil 1650620407670
npm verb unfinished npm timer build:run:install:node_modules/utf-8-validate 1650620407692
npm verb code 127

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/johnnycheng/.npm/_logs/2022-04-22T09_39_45_773Z-debug-0.log

我项目的 package.json:

{
  "name": "coin-web-test2",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@emotion/react": "^11.9.0",
    "@emotion/styled": "^11.8.1",
    "@fontsource/roboto": "^4.5.5",
    "@mui/material": "^5.6.2",
    "@testing-library/jest-dom": "^5.14.1",
    "@testing-library/react": "^13.0.0",
    "@testing-library/user-event": "^13.2.1",
    "crypto-js": "^3.1.9-1",
    "ethers": "^5.6.4",
    "react": "^18.0.0",
    "react-dom": "^18.0.0",
    "react-router-dom": "^6.3.0",
    "react-scripts": "4.0.3",
    "web-vitals": "^2.1.0",
    "web3": "^1.7.3"
  },
  "scripts": {
    "start": "NODE_ENV=production node_modules/react-scripts/bin/react-scripts.js start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

在此处查看完整的错误日志:Full error log

环境:macOS 12.3.1 蒙特雷

节点版本:v16.14.2

npm 版本:8.7.0

【问题讨论】:

  • 您使用什么操作系统环境来执行此操作?
  • macOS montery 12.3.1

标签: javascript reactjs npm node-gyp


【解决方案1】:

运行 yarn install 然后 npm install 以某种方式工作。

不知道如何。如果有人能解释原因就好了

【讨论】:

  • 你的锁文件只在纱线中吗?
  • 这个解决方案对我也有帮助 yarn install 然后 npm install
猜你喜欢
  • 2017-02-10
  • 1970-01-01
  • 1970-01-01
  • 2023-02-04
  • 2021-06-23
  • 2016-11-13
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多