npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

Support for web components

The idea to add better support for web components.
As you may know the WC community shifted from Bower towards npm to install WC dependencies. The problem starts when updating dependencies of your project. A web component can be registered in the browser only once. NPM’s structure allows duplicated of a web components in node_modules nested directory. That leads to potential errors when running the application as a component from a sub node_modules directory is being used again. The browsers throws error (as there can be only one registered component) and halts the execution. I am seeing this issue quite often after updating the dependencies. In this case I have to remove package-lock file and node_modules and install dependencies again.
I was thinking, maybe a CLI option to ensure flat directory structure? Or some other option that ensures that a dependency can be installed only once in the top node_modules directory.