Issue with node.js module - Sleep

Hi, I have a fresh install of node.js but for some reasons, I have the following error :

ActionService An error occurred while executing the action "builtin/waitforApprove [Error, Module “sleep” not found. Tried these locations: “/opt/botpress/modules/.cache/module__07792467c39bdcc4e171ca5371dcb1af9595dbe683b88f49191034eb35356614, /opt/botpress/data/global/actions/builtin”]

but my “sleep” module looks to be correctly installed … ( checked with npm install and npm audit fix )
any suggestion ?

For info

/usr/lib/node_modules/npm# npm install system-sleep
npm WARN marked-man@0.6.0 requires a peer of marked@^0.6.2 but none is installed. You must install peer dependencies yourself.

  • system-sleep@1.3.6
    updated 1 package and audited 13412 packages in 3.918s

14 packages are looking for funding
run npm fund for details

found 0 vulnerabilities

Hi @smalldragoon ,

In order to add external dependencies to your actions, you need to create a custom module and add the actions to your module. Also, you will need to to add your external dependencies (here, system-sleep) to your module’s package.json file.

More information can be found here .

Hope this helps!

hi @spgin, thanks for your reply.
I’m a newbie to botpress and even with the link you provided for explanation, I’m not sure to understand what I should do.
I found a package.json in botpress directiry : data/bots/basic/basic/ , but I don’t understand how can I add “system-sleep” here.
could you share with me one example ?

This is the code I have for the API call btw ( any comments as well ? )

var https = require(‘follow-redirects’).https;
var fs = require(‘fs’);

var options = {
‘method’: ‘POST’,
‘hostname’: ‘my host’,
‘port’: 80,
‘path’: ‘/api/assert?uid=john&sid=f2f5737e-0d1d-4feb-98a4-19e8b907254d’,
‘headers’: {
‘Authorization’: ‘Token test; tid=test’,
‘Content-Type’: ‘application/json’
‘maxRedirects’: 20

var req = https.request(options, function (res) {
var chunks = [];

res.on(“data”, function (chunk) {

res.on(“end”, function (chunk) {
var body = Buffer.concat(chunks);

res.on(“error”, function (error) {

var postData = JSON.stringify({“assertion_id”:“6ilsIZAvdFXjigorwTazEUzQ”,“action”:“authentication”,“jwt”:“HLpK1x4xoyR/N7gFkUogWYM3”,“data”:{“approval_id”:“7afadf9b-4092-4b1a-89c3-3acc161c2577”}});


I’m not a coder, I got it from postman code generation ( node.js native )
Thanks a lot !

issue solved by another method
for reference , the post is here : How to add an external module ( ex : system-sleep ) to package.json?