Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

yarn build: run scripts failed in package.json

オープン
#3,154 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
node.js
領域
build-system

調査の方向性

package.json のスクリプトと報告された node-gyp configure/build コマンドを使って Windows の失敗を再現します。node-gyp の直接呼び出しと Yarn が起動するコマンドを比較し、参照されている node-gyp の log.js スタックを調査します。Yarn のビルドパスが報告された Logger エラーなしで完了すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Steps

  1. npm install node-gyp -g
  2. yarn init
  3. create hello.cc, binding.gyp, index.js

package.json


  "scripts": {
    "build": "node-gyp configure && node-gyp build",
    "run:demo": "node index.js"
  },

run directly success


node-gyp build
gyp info it worked if it ends with ok
gyp info using node-gyp@11.2.0

but run from yarn failed


yarn build
yarn run v1.22.22
$ node-gyp configure && node-gyp build

E:\lab\node-gyp-demo>if not defined npm_config_node_gyp (node "C:\programs\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure )  else (node "" configure ) 
C:\programs\nodejs\node_modules\npm\node_modules\node-gyp\lib\log.js:80
    log.pause()
        ^

TypeError: Cannot read properties of undefined (reading 'pause')
    at new Logger (C:\programs\nodejs\node_modules\npm\node_modules\node-gyp\lib\log.js:80:9)
    at Object.<anonymous> (C:\programs\nodejs\node_modules\npm\node_modules\node-gyp\lib\log.js:164:11)
    at Module._compile (node:internal/modules/cjs/loader:1562:14)
    at Object..js (node:internal/modules/cjs/loader:1699:10)
    at Module.load (node:internal/modules/cjs/loader:1313:32)
    at Function._load (node:internal/modules/cjs/loader:1123:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1335:12)
    at require (node:internal/modules/helpers:136:16)

Node.js v22.13.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

主要言語
Python
スター
10.7k
フォーク
1.9k
平均マージ
1日 4時間
マージ済み PR(30日)
5

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nodejs/node-gyp のほかの issue

nodejs/node-gyp の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。