•  
      request #23480 Fix errors on npm re-install/rebuild
    Infos
    #23480
    Thomas Gerbet (tgerbet)
    2021-11-02 16:19
    2021-11-02 14:35
    25026
    Details
    Fix errors on npm re-install/rebuild

    In some situations calling pnpm install fails with:

    .../esbuild@0.13.5/node_modules/esbuild postinstall$ node install.js
    │ /home/thomas/Workspace/Enalean/tuleap/node_modules/.pnpm/esbuild@0.13.5/node_modules/esbuild/bin/esbuild:1
    │ ELF
    │ ^
    │ SyntaxError: Invalid or unexpected token
    │     at Object.compileFunction (node:vm:352:18)
    │     at wrapSafe (node:internal/modules/cjs/loader:1031:15)
    │     at Module._compile (node:internal/modules/cjs/loader:1065:27)
    │     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    │     at Module.load (node:internal/modules/cjs/loader:981:32)
    │     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    │     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
    │     at node:internal/main/run_main_module:17:47
    │ node:child_process:826
    │     err = new Error(msg);
    │           ^
    │ Error: Command failed: node /home/thomas/Workspace/Enalean/tuleap/node_modules/.pnpm/esbuild@0.13.5/node_modules/esbuild/bin/esbuild --version
    │ /home/thomas/Workspace/Enalean/tuleap/node_modules/.pnpm/esbuild@0.13.5/node_modules/esbuild/bin/esbuild:1
    │ ELF
    │ ^
    │ SyntaxError: Invalid or unexpected token
    │     at Object.compileFunction (node:vm:352:18)
    │     at wrapSafe (node:internal/modules/cjs/loader:1031:15)
    │     at Module._compile (node:internal/modules/cjs/loader:1065:27)
    │     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    │     at Module.load (node:internal/modules/cjs/loader:981:32)
    │     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    │     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
    │     at node:internal/main/run_main_module:17:47
    │     at checkExecSyncError (node:child_process:826:11)
    │     at Object.execFileSync (node:child_process:864:15)
    │     at validateBinaryVersion (/home/thomas/Workspace/Enalean/tuleap/node_modules/.pnpm/esbuild@0.13.5/node_modules/esbuild/install.js:93:32)
    │     at /home/thomas/Workspace/Enalean/tuleap/node_modules/.pnpm/esbuild@0.13.5/node_modules/esbuild/install.js:238:5 {
    │   status: 1,
    │   signal: null,
    │   output: [
    │     null,
    │     Buffer(0) [Uint8Array] [],
    │     Buffer(681) [Uint8Array] [
    │        47, 104, 111, 109, 101,  47, 116, 104, 111, 109,  97, 115,
    │        47,  87, 111, 114, 107, 115, 112,  97,  99, 101,  47,  69,
    │       110,  97, 108, 101,  97, 110,  47, 116, 117, 108, 101,  97,
    │       112,  47, 110, 111, 100, 101,  95, 109, 111, 100, 117, 108,
    │       101, 115,  47,  46, 112, 110, 112, 109,  47, 101, 115,  98,
    │       117, 105, 108, 100,  64,  48,  46,  49,  51,  46,  53,  47,
    │       110, 111, 100, 101,  95, 109, 111, 100, 117, 108, 101, 115,
    │        47, 101, 115,  98, 117, 105, 108, 100,  47,  98, 105, 110,
    │        47, 101, 115,  98,
    │       ... 581 more items
    │     ]
    │   ],
    │   pid: 32469,
    │   stdout: Buffer(0) [Uint8Array] [],
    │   stderr: Buffer(681) [Uint8Array] [
    │      47, 104, 111, 109, 101,  47, 116, 104, 111, 109,  97, 115,
    │      47,  87, 111, 114, 107, 115, 112,  97,  99, 101,  47,  69,
    │     110,  97, 108, 101,  97, 110,  47, 116, 117, 108, 101,  97,
    │     112,  47, 110, 111, 100, 101,  95, 109, 111, 100, 117, 108,
    │     101, 115,  47,  46, 112, 110, 112, 109,  47, 101, 115,  98,
    │     117, 105, 108, 100,  64,  48,  46,  49,  51,  46,  53,  47,
    │     110, 111, 100, 101,  95, 109, 111, 100, 117, 108, 101, 115,
    │      47, 101, 115,  98, 117, 105, 108, 100,  47,  98, 105, 110,
    │      47, 101, 115,  98,
    │     ... 581 more items
    │   ]
    │ }
    └─ Failed in 122ms
     ELIFECYCLE  Command failed with exit code 1.
    

    This caused by an issue in the esbuild install script, see https://github.com/evanw/esbuild/commit/6f40235afb5e5ccd62b71bafd144b9a34374d6cb

    Dev tools
    Empty
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Thomas Gerbet (tgerbet)
    Closed
    2021-11-02
    Attachments
    Empty
    References

    Follow-ups

    User avatar

    Integrated into Tuleap 13.1.99.86


    • Status changed from Under review to Closed
    • Connected artifacts
    • Close date set to 2021-11-02