Cannot Find Module

Recently i am working with node JS and came across some functions in aws-sdk package, i tried in vs code, but i wanted to integrate those with openbullet2, so i used a script block but came across

[Executing block Script] InvocationException: Jering.Javascript.NodeJS.InvocationException: Cannot find module ‘aws-sdk’
Require stack:

Error: Cannot find module ‘aws-sdk’
Require stack:

i have installed the package globally , even installed in scripts folder again, verified using npm list aws-ask, both inside scripts and global , everything seems fine but openbullet2 throws an error



If you use version 0.3.1, needs open cmd normaly but not in scripts folder,
u only open and type npm i aws-sdk not needs install global .

Tried even that did not worked

BLOCK:Script
INTERPRETER:NodeJS
INPUT 
BEGIN SCRIPT
const AWS = require('aws-sdk');

AWS.config.update({ region: 'us-west-2' });

const s3 = new AWS.S3();
END SCRIPT
OUTPUT String @s3
ENDBLOCK

This code works fine for me without needing to do any special install, just npm install aws-sdk. Sharing your (partial) script would help.

OB needs to be in deskop for example, in partitions u gets error.

Are you on the latest build? Because there’s this issue v0.3.1 no detect Node modules. · Issue #1071 · openbullet/OpenBullet2 · GitHub

I was on 0.3.0

20chars

Yes, 0.3.0 works. Since one PR that was merged, using packages is broken. I will fix it soon.

1 Like

atm im using 0.3.2 and have ob2 installed on (D:/) drive and node modules were not loading, i copy pasted whole ob2 folder into desktop and it worked there.
Also is it possible to keep in (D:) drive and remove requirement of installing node modules under scripts folder?
i usually install node modules like this:
open cmd in scripts folder
npm init -y
npm i moduleName