Skip to content

NodeJS packed as correlation payload doesn't preserve symbolic links #64473

Closed
@maraf

Description

@maraf

NodeJS packed as correlation payload doesn't preserve symbolic links. Instead it copies target files to places where links sit.

node/14.15.5_64bit should contain

npm -> ../lib/node_modules/npm/bin/npm-cli.js*
npx -> ../lib/node_modules/npm/bin/npx-cli.js*

Running npm could cause errors like (#64330)

internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module '../lib/utils/unsupported.js'
Require stack:
- /datadisks/disk1/work/BA3509B2/p/build/emsdk/node/14.15.5_64bit/bin/npm
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at /datadisks/disk1/work/BA3509B2/p/build/emsdk/node/14.15.5_64bit/bin/npm:19:21
    at Object.<anonymous> (/datadisks/disk1/work/BA3509B2/p/build/emsdk/node/14.15.5_64bit/bin/npm:155:3)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/datadisks/disk1/work/BA3509B2/p/build/emsdk/node/14.15.5_64bit/bin/npm'
  ]
}

Possible solutions

  • Use cli zip to pack the nodejs with correct symlinks
  • Install/extract nodejs on Helix using emsdk installation script (it uses python to download and extract it).
  • Download and extract nodejs from official site, like emsdk does it.
  • Install nodejs on Helix VM image
  • Use nodejs from emsdk nuget package (it is stripped, eg npm is missing)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions