Allow node modules to have node modules as dependencies
See original GitHub issueIssue Description
Node-red scans for node_modules
directories starting from its install location and working up the tree to the root path. When it finds such a directory, it examines the package.json
files of the modules in the directories immediately below; it doesn’t scan deeper for additional node_module
directories.
This means a node module cannot declare another node module as a dependency and have it load properly - which is a reasonable thing to allow.
- when a valid node-red node module is discovered, scan its
node_modules
directory - ensure we are recording the version number of node modules
- if a node module is found that we have already loaded:
- if the version number matches, skip it and carry on.
- if the version numbers don’t match, refuse to load it (and if this was in a node module’s node_module directory, refuse to load the top level module as its dependency cannot be satisfied)
Issue Analytics
- State:
- Created 8 years ago
- Comments:26 (11 by maintainers)
Top Results From Across the Web
Understanding dependency management with Node Modules
Packages can be installed in projects on your local machine using a command line package manager such as npm or yarn and are...
Read more >How To Use Node.js Modules with npm and package.json
Packages that are used for the development of a project but not for building or running it in production are called development dependencies....
Read more >How to specify local modules as npm package dependencies
json dependencies structure. Using the --save option in this command is simply putting "mymodule": "0.0.0" into my package.json ( ...
Read more >Requiring modules in Node.js: Everything you need to know
Node modules have a one-to-one relation with files on the file-system. We require a module by loading the content of a file into...
Read more >Creating Node.js modules - npm Docs
To create a package.json file, on the command line, in the root directory of your Node.js module, run npm init : · Provide...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just to provide a bit of perspective. Due to this bug, to install FlexDash using the palette manager I would have to tell users to manually install node-red-fd-corewidgets and node-red-flexdash and node-red-flexdash-plugin. Most likely, there’s also going to be a node-red-flexdash-sidebar to add to the list. If a user installs the corewidgets but forgets to install one of the other packages then at a first glance everything seems to work, except that config nodes are missing and therefore the input fields in the flow editor don’t work. The net result are nodes that seemingly are there but somehow don’t work.
Instead, I will have to recommend to install using npm, where just installing node-red-fd-corewidgets before launching node-red brings in everything else and works properly.
This is particularly a shame when using docker, because instead of just something like
and then using the flow-manager to get FlexDash one has to run:
you can also use
npm pack
to package your code locally into an installable tgz file without having to publish it. You can then install it withnpm i your_package_name.tgz