yarn build: run scripts failed in package.json
还没有人认领这个 Issue。
评估
- 难度
- 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
- npm install node-gyp -g
- yarn init
- 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 小时
- 30 天内合并 PR
- 5
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nodejs/node-gyp 的其他 Issue
-
dependencies github_actions
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 4/5 3-5 天 新手友好度 48/100
-
难度 4/5 3-5 天 新手友好度 48/100
-
MSYS2
难度 4/5 3-5 天 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 48/100
相似的 Issue
-
agent-ready documentation needs-triage
难度 1/5 1-3 小时 新手友好度 88/100
-
documentation
难度 1/5 1 小时以内 新手友好度 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" 未关闭
难度 1/5 1 小时以内 新手友好度 92/100
-
instance instance add
难度 1/5 1 小时以内 新手友好度 72/100
searxng/searx-instances#939 · 1 条评论 ·
-
area-deployment area-integrations triage:bot-seen
难度 2/5 半天 新手友好度 86/100