Having recently installed an instance of @TotallyInformation alternate install on my Win 10 machine, I noticed that the Blocky node (node-red-contrib-blockly) came with it.
Julian has pointed out to me that he doesn't supply any nodes pre-installed and that I probably installed it globally in the past
Since I was a beta tester, this is quite likely
I'm wondering what is the best way to resolve this situtation without mucking up my main standard Node-RED install running on same Win machine
Its complicated by the fact that I'm running V1.2.0 of the node from github and not the standard npm 1.1.0 version
If you remove global modules but still need to use one, you would need to install locally. Same as you are doing with Node-RED itself.
Modules are contained by a folder with an entry in a package.json
Bottom line is that you should just do a npm remove -g node-red-contrib-blockly, restart node-red and see if the blockly node still turns up.
If you really get stuck, you can search your drive(s) for node_module folders and find any sub-folders called node-red-contrib-blockly and just delete them.
If you break something, you can just install the node again.
i did the global un-install but the node didn't disappear from the alternate install so I'm now hunting it down thru my file system but I've a feeling this is going to take some time
In the meantime, if I could ask a followup question picking up on "There is no magic to npm modules."
If I install nodes via palette in alternate install, why do they put into ./data/node-modules rather than into ./node-modules like the standard NR install does?
OK, so it looks like you have some blockly bits left in your global install but not the node.
You have the node installed in your default userDir (~/.node-red) so if you are using a globally installed copy of Node-RED, that is fine.
However, if you are using a locally installed version - like my installer creates - you need to also install it in the data folder of that installation which is the userDir that you give to the Node-RED instance. Obviously, the easiest way to get that right is to use the palette manager.
If the palette is installing to the "wrong" place, it is because your userDir isn't pointed where you think it is for the running instance. The palette should always be installing to the userDir (as defined in your startup script) and your manual installs should be in the same folder.
Easy enough to check. The package.json file in the userDir will show you whether you have that module installed from GitHub or npm. You could even create a flow to import it and view it. Just note that, if running from the alt. installer, the current working directory in Node-RED will be wherever you installed Node-RED, it won't be the userDir.
Also worth noting that the root folder that the alt. installer uses has it's own package.json file of course since that is where the Node-RED package is installed. You can install Node-RED custom node packages to that folder as well - but then you cannot manage those from the palette and it gets very confusing so best avoided.
One last point - you did restart Node-RED after installing manually? Installing from the palette often gets away without needing to restart but that doesn't work when installing manually.
I think, I've not actually tried that one - you could make everything absolute references of course and then you might save some confusion. Though it wouldn't then work without tweaking if you ever move it. The advantage of the settings is that they don't need to take account of the location of the parent folder. and even if you rename that folder or copy it somewhere, everything still works as expected.
cd ~/.nrxxxx
npm install --save https://github.com/cymplecy/node-red-contrib-simpletime.git#tickboxes
I keep everything on my dev PC under the c:\src folder:
cd c:\src\nr2
# This is where node-red was installed
cd data
# This is the userDir
npm install --save https://github.com/cymplecy/node-red-contrib-simpletime.git#tickboxes
On my home server everything is under my normal login and Node-RED lives in ~\nrlive, it looks like this:
cd ~\nrlive
# This is where node-red was installed
cd data
# This is the userDir
npm install --save https://github.com/cymplecy/node-red-contrib-simpletime.git#tickboxes
Is /home/pi/.nr18884_simpletime where you have Node-RED installed or is it the userDir you are using?
If the latter, that is exactly where you should be and you will end up with a folder /home/pi/.nr18884_simpletime/node_modules/node-red-contrib-simpletime/ and an entry in /home/pi/.nr18884_simpletime/package.json showing simpletime is a dependency and is using the GitHub version.
Manage Palette will show the node and whatever version number is in the package.json of the installed version as in this example of the dev version of uibuilder:
It doesn't show that it comes from GitHub.
By the way, when installing from GitHub, you can simply do:
OK - I've given up trying to document what is going on as my recorded gif is unreadable!
I turned to googling and came up with the npm --prefix flag
so in my new test /home/pi/nrtest folder (having previously installed simple time using palette and got 2.9.1) I did this
and it updated the existing /home/pi/nrtest/data/node_modules/node-red-contrib-simpletime files to v2.9.6 and updated what it thinks it is installed in the palette
Genuinely, I'm at a loss as to what is happening for you.
The alt. installer actually works in a more node.js/npm way than Node-RED's "recommended" installation and I've never had any issues with it. Though admittedly I always keep the userDir inside the main Node-RED dir since that can then all be moved/copied together.
--prefix is meant to be used if you want to install something to a folder other than the folder you are currently in.
From your command image. It looks to me as though you are in the folder where you installed Node-RED itself but you are trying to install the module to the data subfolder. Not sure why you haven't just cd'd to the subfolder and done a normal install from there?
Assuming you are starting node-red from the ~/nrtest folder with node node_modules/node-red/red.js --userDir ./data then everything would be in the right place anyway.
AFAICT this is just a communication breakdown between us.
The main issue is that you speak npm fluently and I only know 3 words
I think it needs somebody else to bring us together round the table
Anyway - I currently have got both palette installs and npm github installs going into the same folder - so at least I can use it for testing which is my goal
Apologies - having had a sleep and doing a clean install routine a few times I find I don't need the --prefix if I cd into the data folder e.g ~/nrtest/data before doing the npm install.
It does overwrite the previous contrib node install that was installed using palette.
(As previous found out - it doesn't work if I issue the npm install from the basefolder e.g ~/nrtest)