Skip to content

Runtime info broken in NodeJS 12.0.0+ #2530

@SanderKnape

Description

@SanderKnape

Describe the bug
When running NodeJS 12.0.0 or higher (tested with 12.0.0 and 12.1.0), the runtime information does not contain the versions for the private NodeJS libraries anymore. The require.resolve function used here doesn't properly return the package module.

I believe this is a breaking change introduced in NodeJS 12.0.0 through this PR: nodejs/node#23683

Maybe for now it's an option to add a NodeJS version constraint to the package.json file with a < 12.0.0.

To Reproduce

  • Install NodeJS 12.0.0 or higher (e.g. through nodenv)
  • Run the tests for the CDK app
cd /path/to/aws-cdk/packages/@aws-cdk/cdk
../../../node_modules/.bin/nodeunit test/test.app.js
  • Note how the runtime library versions and version reporting includes only @aws-cdk, aws-cdk and jsii libraries tests fail

Expected behavior
Non-failing tests

Version:

  • OS: OSX
  • Programming Language: NodeJS 12.0.0 +
  • CDK Version: 0.31.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.closing-soonThis issue will automatically close in 4 days unless further comments are made.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions