0

I want to deploy an Angular 12 app that uses d3-org-chart, which in turn imports d3-flextree. When I start my project using ng build it generates the following error:

./node_modules/d3-flextree/src/flextree.js:247:19-26 - Error: Should not import the named export 'version' (imported as 'version') from default-exporting module (only default export is available soon)

I can see that the error was fixed in the project GitHub repository in this commit, and I made the same change locally and it works fine.

Another developer has raised an issue on the project page to get the NPM package updated.

My issue is that the code was fixed in github, but not updated on NPM. So when I use npm install, or when I deploy my app in a docker container which then runs ng build it pulls down the outdated NPM version and the error occurs, preventing startup.

Obviously, this will be fixed when the maintainer updates the NPM package, but until this happens what is the least ugly solution to enable me to deploy my docker container without the error?

RobC
  • 22,977
  • 20
  • 73
  • 80
ben
  • 321
  • 4
  • 12
  • 1
    Does [this](https://stackoverflow.com/questions/17509669/how-to-install-an-npm-package-from-github-directly) answer your question? Just install the github version, not the npm one. – Taxel Aug 31 '21 at 14:12
  • That's a good idea Taxel. I've run npm install https://github.com/klortho/d3-flextree, the next issue I'm having is that the 'clean' step that projects package.json runs 'rm', which fails on Windows ("rm is not recognized as an internal or external command"), but I'll persevere. I think your suggestion is the winner after I do some work arounds for the 'rm' issue work (or moving to Linux). Thank you. – ben Sep 01 '21 at 02:54
  • Taxel - using the link you gave me I forked the d3-flextree project, fixed some issues preventing execution, then ran npm install https://github.com//d3-flextree and it worked. Thanks for the suggestion! How do I mark your answer correct? – ben Sep 01 '21 at 03:46

0 Answers0