v8.h node-gyp 缺失

v8.h missing from node-gyp

在 truffle (https://github.com/swisstackle/truffle) . I forked the repo from https://github.com/trufflesuite/truffle

的 forked/clones 存储库中执行“yarn bootstrap”时出现上述错误

这是最后一个日志文件:

 0 verbose cli [
    0 verbose cli   'C:\Program Files\nodejs\node.exe',
    0 verbose cli   'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
    0 verbose cli   'exec',
    0 verbose cli   '--',
    0 verbose cli   'run',
    0 verbose cli   'rebuild'
    0 verbose cli ]
    1 info using npm@8.3.1
    2 info using node@v16.14.0
    3 timing npm:load:whichnode Completed in 0ms
    4 timing config:load:defaults Completed in 4ms
    5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 4ms
    6 timing config:load:builtin Completed in 4ms
    7 timing config:load:cli Completed in 3ms
    8 timing config:load:env Completed in 7ms
    9 timing config:load:file:C:\Users\alain\Git\truffle\node_modules\ursa-optional\.npmrc Completed in 1ms
    10 timing config:load:project Completed in 3ms
    11 timing config:load:file:C:\Users\alain\.npmrc Completed in 0ms
    12 timing config:load:user Completed in 1ms
    13 timing config:load:file:C:\Users\alain\AppData\Roaming\npm\etc\npmrc Completed in 1ms
    14 timing config:load:global Completed in 1ms
    15 timing config:load:validate Completed in 4ms
    16 timing config:load:credentials Completed in 1ms
    17 timing config:load:setEnvs Completed in 2ms
    18 timing config:load Completed in 32ms
    19 timing npm:load:configload Completed in 33ms
    20 timing npm:load:setTitle Completed in 2ms
    21 timing config:load:flatten Completed in 5ms
    22 timing npm:load:display Completed in 6ms
    23 verbose logfile C:\Users\alain\AppData\Local\npm-cache\_logs22-05-20T06_19_01_219Z-debug-0.log
    24 timing npm:load:logFile Completed in 7ms
    25 timing npm:load:timers Completed in 0ms
    26 timing npm:load:configScope Completed in 0ms
    27 timing npm:load Completed in 50ms
    28 silly logfile start cleaning logs, removing 21 files
    29 silly logfile error removing log file C:/Users/alain/AppData/Local/npm-cache/_logs/2022-05-20T05_54_36_838Z-debug-0.log [Error: EPERM: operation not permitted, unlink 'C:\Users\alain\AppData\Local\npm-cache\_logs22-05-20T05_54_36_838Z-debug-0.log'] {
    29 silly logfile   errno: -4048,
    29 silly logfile   code: 'EPERM',
    29 silly logfile   syscall: 'unlink',
    29 silly logfile   path: 'C:\Users\alain\AppData\Local\npm-cache\_logs\2022-05-20T05_54_36_838Z-debug-0.log'
    29 silly logfile }
    30 silly logfile error removing log file C:/Users/alain/AppData/Local/npm-cache/_logs/2022-05-20T05_54_38_424Z-debug-0.log [Error: EPERM: operation not permitted, unlink 'C:\Users\alain\AppData\Local\npm-cache\_logs22-05-20T05_54_38_424Z-debug-0.log'] {
    30 silly logfile   errno: -4048,
    30 silly logfile   code: 'EPERM',
    30 silly logfile   syscall: 'unlink',
    30 silly logfile   path: 'C:\Users\alain\AppData\Local\npm-cache\_logs\2022-05-20T05_54_38_424Z-debug-0.log'
    30 silly logfile }
    31 http fetch GET 200 https://registry.yarnpkg.com/run 265ms (cache revalidated)
    32 timing arborist:ctor Completed in 1ms
    33 timing arborist:ctor Completed in 0ms
    34 timing arborist:ctor Completed in 0ms
    35 silly logfile error removing log file C:/Users/alain/AppData/Local/npm-cache/_logs/2022-05-20T05_54_40_145Z-debug-0.log [Error: EPERM: operation not permitted, unlink 'C:\Users\alain\AppData\Local\npm-cache\_logs22-05-20T05_54_40_145Z-debug-0.log'] {
    35 silly logfile   errno: -4048,
    35 silly logfile   code: 'EPERM',
    35 silly logfile   syscall: 'unlink',
    35 silly logfile   path: 'C:\Users\alain\AppData\Local\npm-cache\_logs\2022-05-20T05_54_40_145Z-debug-0.log'
    35 silly logfile }
    36 timing command:exec Completed in 373ms
    37 verbose exit 1
    38 timing npm Completed in 1242ms
    39 verbose code 1

我尝试了多种在 stack overflow 或其他网站上推荐的东西:

还有什么我可以尝试的吗?我只是在关注 https://github.com/trufflesuite/truffle/blob/develop/CONTRIBUTING.md

上的 contributions.md 教程

更新:我有一些进步:

根据日志文件,我发现 node-gyp 中的 v8.h 丢失了。我重新安装了 node-gyp 并解决了这个问题。

下一个错误是 truffle 的脚本文件夹中的某些文件仍然有 windows 空格,所以我用 sed -i 's/\r//g' 删除了它们并解决了问题

然后,又出现了一个问题,我还没有解决: 当 yarn 尝试构建 truffle 仪表板包时,出现错误 'DISABLE_ESLINT_PLUGIN' is not recognized as an internal or external command 在没有 eslint

的 package.json 到 运行 反应脚本中使用

根据 react-scripts,此标签是随版本 4.0.2 添加的,但仪表板包中的 package.json 引用 react-scripts 版本 4.0.0。这让我有点困惑,因为如果 consensys 的开发人员使用 4.0.0 版,他们怎么能用这个标签构建仪表板包?我将为 that.Pro

打开一个单独的问题

问题是 node-gyp 缺少 v8.h:我很快解决了重新安装 nodegyp 的问题:npm install node-gyp -g

但是,之后出现了更多与原始错误无关的错误。我更新的问题文本中有更多详细信息。我会针对这些错误提出一个单独的问题。