Page 1 of 1

Error in Node.js Scripting within Switch

Posted: Mon Apr 29, 2024 12:25 pm
by gregbowers
Hello

I'm facing an issue while working with Node.js scripting in Switch. When trying to execute a script, I am getting a 'Module not found' error for a dependency, even though it's installed correctly using npm. I've rechecked the paths and verified that the module is listed in the package.json file.

Has anyone else faced this issue before, and if so, how did you resolve it? Any help would be greatly appreciated.

Thank you for your assistance!

Thank you
gregbowers
memberlist.php?mode=viewprofile&u=4437info

Re: Error in Node.js Scripting within Switch

Posted: Mon Apr 29, 2024 1:17 pm
by plutinolabs
Hi gregbowers

I've been going through that last couple of weeks. In my case, I found downgrading modules worked for me.
I think some of the newer modules are incompatible with the node runtime that's installed with switch?

Re: Error in Node.js Scripting within Switch

Posted: Tue Apr 30, 2024 10:47 am
by tdeschampsBluewest
There is a similar issue for nodeFetch and some release of axios, downgrading your package can (sometime) fix the issue as stated earlyer

Example of installation : npm i axios@0.27.2

Re: Error in Node.js Scripting within Switch

Posted: Mon Jul 01, 2024 11:13 am
by foxpalace
normal is that not - I use node-exiftool ... in a older Script Version 2.3.0 is working - now i create a script, npm i node-exiftool ... not working - same version 2.3.0

Code: Select all

Error: Failed to transpile the code: TypeScript failed with exit code 2
Error: TypeScript standard output: main.ts(1,27): error TS7016: Could not find a declaration file for module 'node-exiftool'. '/Users/Shared/nodejs/dev/insertXMP/node_modules/node-exiftool/src/index.js' implicitly has an 'any' type.
Who should unterstand that - exactly same version

Re: Error in Node.js Scripting within Switch

Posted: Mon Jul 01, 2024 1:47 pm
by foxpalace
Hi, in my old Script I worked whit import - now it worked whit require:

Code: Select all

const exiftool = require('node-exiftool');
If someone have the same Problem - try require.