question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cdk synth fails to resolve symlinks when staging assets as of 1.16.0

See original GitHub issue

❓ General Issue

The Question

After upgrading from 1.15.0 to 1.16.1, cdk synth command fails with:

Error: ENOENT: no such file or directory, symlink '../fast-xml-parser/cli.js' -> 'cdk.out/asset.046889af674a59f8c3e80adeeadca2bd0a4922e131160a62c280be1c0d15a097/node_modules/.bin/xml2js'

fast-xml-parser is a dependency I have under lib/resources/package.json used by a lambda function.

Any idea where those symlinks come from or what creates them? And how to clean them / regenerate them.

Also running cdk synth and then cdk diff again seems to remove the issue and diff says No differences. But I have same issue running jest for the tests for the lambda (same missing symlink warning). If I revert back to 1.15.0, both work.

Environment

  • CDK CLI Version: 1.16.1 (build 9a5a761)
  • OS: Ubuntu
  • Language: TypeScript

Other information

Error: ENOENT: no such file or directory, symlink '../fast-xml-parser/cli.js' -> 'cdk.out/asset.046889af674a59f8c3e80adeeadca2bd0a4922e131160a62c280be1c0d15a097/node_modules/.bin/xml2js'
    at Object.symlinkSync (fs.js:909:3)
    at Object.copyDirectory (/home/vertti/dev/kesko/k-ruoka-product-service/importers/ttp-importer/node_modules/@aws-cdk/assets/lib/fs/copy.ts:25:14)
    at Staging.synthesize (/home/vertti/dev/kesko/k-ruoka-product-service/importers/ttp-importer/node_modules/@aws-cdk/assets/lib/staging.ts:87:7)
    at Function.synth (/home/vertti/dev/kesko/k-ruoka-product-service/importers/ttp-importer/node_modules/@aws-cdk/core/lib/construct.ts:56:28)
    at App.synth (/home/vertti/dev/kesko/k-ruoka-product-service/importers/ttp-importer/node_modules/@aws-cdk/core/lib/app.ts:142:36)
    at process.App.process.once (/home/vertti/dev/kesko/k-ruoka-product-service/importers/ttp-importer/node_modules/@aws-cdk/core/lib/app.ts:121:45)
    at Object.onceWrapper (events.js:286:20)
    at process.emit (events.js:198:13)
    at process.EventEmitter.emit (domain.js:448:20)
    at process.emit (/home/vertti/dev/kesko/k-ruoka-product-service/importers/ttp-importer/node_modules/source-map-support/source-map-support.js:485:21)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
hanstfcommented, Nov 13, 2019

same problem here but after installing the lambda dependencies with npm install --no-bin-links then deployment works.

2reactions
jd-carrollcommented, Nov 17, 2019

In case anyone else sees this, just add the following to your package.json

  "resolutions": {
    "@aws-cdk/assets": "1.15.0",
    "@aws-cdk/core": "^1.16.0",
    "@aws-cdk/cx-api": "^1.16.0"
  }

If you have a mono-repo, place it in the root

Read more comments on GitHub >

github_iconTop Results From Across the Web

awslabs/aws-cdk - Gitter
After updating to 1.16.1, cdk deploy does not take the env code in Python. I tried running the sample app - its asking...
Read more >
cdk-assets | Yarn - Package Manager
We expect assets to be immutable, and we expect that immutability to be reflected both in the asset ID and in the destination...
Read more >
core 1.181.1 javadoc (software.amazon.awscdk)
Options applied when copying directories into the staging location. ... can post-process the complete resolved value, after resolve() has recursed over it.
Read more >
getting error whenever try to deploy backend with cdk via ...
For that, please make sure either you are using the latest version of cdk, or you DO NOT HAVE ANY WHITE SPACES IN...
Read more >
MetaDefender Core v4.18.0 - OPSWAT Knowledge Center
MetaDefender Core v4 shows a large number of files that failed to scan. ... Follow the installation steps according to your operating system...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found