Domino10 appDevPack: "Error: Cannot find module '#domino/domino-db'" - node.js

Just installed the latest Domino 10.0.1 Server on my linux machine and also installed and configured the latest proton package. As far as I can tell it's all running fine.
Next I plan to try my first Node-RED flow using the new Domino10 nodes. So I installed the 'node-red-contrib-dominodb' palette.
Finally tried my first very simple flow trying to query node-demo.nsf as it's described here. From what I read there I assumed that it's sufficient to install the palette, but that obviously is not the case:
as soon as I hit 'Deploy' I receive this error:
Error: Cannot find module '#domino/domino-db'
So I thought that I maybe still have to do a global install in node.js using
npm install -g <package-path>/domino-domino-db-1.1.0.tgz
This indeed created a local #domino/domino-db module inside my node.js npm\node_modules folder. But obviously my node-red environment doesn't know about it.
Question is: how do I register / install that npm package for my local node-red environment?

IBM's instructions (https://flows.nodered.org/node/node-red-contrib-dominodb#Installation)
Say to go view this guide(https://github.com/stefanopog/node-red-contrib-dominodb/blob/master/docs/Using%20the%20new%20Domino%20V10%20NodeRED%20nodes%202.pdf) for installing the domino-db module.
The link is broken, here's an old copy: https://github.com/stefanopog/node-red-contrib-dominodb/blob/a723ef88498c5bfa243abd956a7cc697f0a42610/docs/Using%20the%20new%20Domino%20V10%20NodeRED%20nodes%202.pdf
I believe the section you want is called "Import the tarball". The steps before that require you to unpack and then re-pack the module... which is unnecessary. Just use the tgz that was in the AppDev Pack to begin with.

Related

I’d like to install and require “fs”, ”path”, and “js-yaml” in Windows 10 but only “js-yaml” led to "Error cannot find module "

 Nice to meet you. I'm a beginner in computer and these days have enjoyed your sophisticated Q&As here. This is my first question in StackOverFlow. Please forgive me when I use not common notations and unnatural English.
 I trid for several hours to install external modules in Node-Red (Node.js ?).
I’d like to install three---“fs”, ”path”, and “js-yaml”--- in Windows 10 but my trouble is that only “js-yaml” resulted in failure although the others can be successfully installed and used.
 I tried the following command…
C:\windows\system32>npm –g install js-yaml
C:\windows\system32>npm –g install fs
C:\windows\system32>npm –g install path
These commands created the modules, but only js-yaml behaved differently from the other two. After adding appropriate keys and properties such as “ fs: require(‘fs’)” to functionGlobalContext in (C:~~~/.node-red/) setting.js, I tried to start Node-Red.
When I commanded
C:\windows\system32> node-red
it returned the following errors only on js-yaml and node-red did not open. It ran successfully when I removed the term “jsyaml: require(‘js-yaml’)” from setting.js.
Error loading C:~~~/.node-red/setteing.js
Error cannot find module “js-yaml”
I’ll list reports which may be related with my problem.
*The other two (fs, path) created the folders only in the directory “C:~~~/npm/node-modules”, but js-yaml created another js-yaml file apart from there in “C:~~~/npm”.
*Perhaps I tried “npm link” command in each directory before install command. And npm link [module name] in C:~~~/.node-red directory.
*I downloaded external module (node-red-contrib-postgres) from github, which may have fs.js and path.js??
*It did not change the result to add “js-yaml” term into “dependency” in (C:~~~/.node-red/) package.json.
*I add C:~~~/npm.node_modules(got by "npm -g bin"command) to enviroment variable "PATH"
I would suggest you install them locally, not globally.
When you install npm modules globally using -g, they are stored under %APPDATA%\npm, which is user-specific, and to which Node Red may not have access, depending on how it's being run.
Have a look at Running on Windows under "Sharing Node-RED between Users" and npm-folders for further info.
Alternatively, you can also put the actual path in functionGlobalContext, which may work for you. Along the lines of:
js-yaml: require(‘/the/path/to/js-yaml’)

Not able to run composer rest server

While starting composer rest server I am getting error :
Connection fails: Error: Failed to load connector module "composer-connector-hlfv1" for connection type "hlfv1". Cannot find module '/home/user/.nvm/versions/node/v8.9.3/lib/node_modules/composer-rest-server/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64/grpc_node.node
there is no grpc_node.node file present in the above folder. I tried reinstalling compoer rest server but no luck.
There are lots of reasons for this. the grpc module is a binary module and usually npm will download a prebuilt binary for your platform. If however it cannot do that (eg server down, or the platform is not recognised) then it will attempt to build the binary from source.
You need to look at the output during the npm -g install of composer-rest-server to see what is reported when npm attempts to install grpc to determine what the problem is.
The following advice from another thread has worked for me. Please try:
Rebuild it
Go to the folder cd '/root/.nvm/versi ons/node/v8.9.1/lib/node_modules/composer-rest-server/'
(into the folder where you have 'composer-rest-server')
then run npm rebuild --unsafe-prem
It will work now
source - Error while generating REST api using hyperledger composer-rest-server in centOS

IBM bluemix - NodeRED - failed to install node-red-contrib-chatbot

I'm trying to install redbot in Node-RED, on IBM Bluemix. As suggested here, I'm using Manage palette to install it. I can find it in 'install' tab by typing chatbot. I click on install and then a pop up appears saying:
Before installing, please read the node's documentation. Some nodes
have dependencies that cannot be automatically resolved and can
require a restart of Node-RED.
I click on install again, and after loading a little bit, it shows this message:
Failed to install: node-red-contrib-chatbot Error: install failed
Check log for more information
And the debug tab shows this error message:
Error: Command failed: npm install --production
node-red-contrib-chatbot
I tried to install dependences listed here following the same procedure described in this post, but some of them can't be found from Manage palette. I also tried restarting Node-red but without success.
Is there any alternative? How should I install this properly?
You can only install Node-RED nodes via the manage palette system, not the underlying npm nodes.
The best way to install Node-RED nodes that won't install cleanly via the manage palette option is to edit the Node-RED package.json The easiest way to do this is to go to the Overview page for the application console page in Bluemix. From here click "Edit Code". From here you want to edit the package.json to include node-red-contrib-chatbot in the dependencies section.
"dependencies": {
"node-red-contrib-chatbot": "0.7.1",
...
},
Once you've made the changes you will need to commit and push the changes, this should restart Node-RED and as part of this the node should be installed.
What hardililb says but if the issue is with all nodes - i.e. you cannot add any node, not even a simple one like random, via the Manage Palette, you can fix that. Edit bluemix_settings.js and add:
var fs = require("fs");
Then after the var settings= section (not in it, after it), add:
// Ensure userDir exists
fs.mkdirSync(settings.userDir);
fs.mkdirSync(path.join(settings.userDir,"node_modules"));
Commit and Push.

Secure Gateway client not starting on Linux

I have installed the Secure Gateway client (v1.4.2) on RHEL V7. When I attempt to start the client, I receive an error that log4js cannot be found. I am trying to find out where log4js should reside.
enter image description here
Additional information:
Installation was done as follows:
rpm -ivhf ibm_securegateway_client_1.4.2_x86_64.rpm --force
Hardware: Intel (not AMD)
The installation log indicated that the install was successful.
Please add --force option on Redhat Version 7.
rpm -ivhf --force ibm-securegateway-client-1.4.2+client_amd64.rpm
It looks like your node modules did not install correctly. Please ensure you have the correct permissions and reinstall so the node modules can be correctly added.
On a side note, you may encounter issues when attempting to start the client from outside the client directory due to how it searches for the associated files.

NPM alias node-postgres to node-postgres-pure

I'm building a nodejs application that needs to run on a Windows server. I've managed to get almost everything working, but I've ran into a problem with the postgresql driver. BrianC has a pure javascript implementation of the node-postgres that I would like to use to avoid having to build the postgres driver.
Is there a way for me to alias node-postgres(npm:pg) to node-postgres-pure(npm:pg.js) so that any dependent package that tries to install and resolve pg will install and resolve pg.js instead?
Thanks
Take a look at node-pg-pure-alias.
It's a bit of a hack, but the idea is to get a package that calls itself 'pg' installed into your node_modules folder. Then, that 'pg' library can export the "real" library.
See #it's not in npm! if you're concerned about depending on a package that's not in the official npm repository.
Disclaimer: I created node-pg-pure-alias. (All ten lines of the package.json, that is.)

Resources