Error in Node.js Scripting within Switch

Post Reply
gregbowers
Newbie
Posts: 3
Joined: Thu Apr 18, 2024 8:04 am

Error in Node.js Scripting within Switch

Post 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
plutinolabs
Newbie
Posts: 8
Joined: Sat May 13, 2023 2:07 pm

Re: Error in Node.js Scripting within Switch

Post 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?
User avatar
tdeschampsBluewest
Member
Posts: 75
Joined: Tue Jun 01, 2021 11:57 am

Re: Error in Node.js Scripting within Switch

Post 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
Do you like the Enfocus Apps developed by Bluewest?
Feel free to leave a comment on the Appstore!
User avatar
foxpalace
Member
Posts: 37
Joined: Fri Jan 14, 2011 12:25 pm
Location: Germany

Re: Error in Node.js Scripting within Switch

Post 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
User avatar
foxpalace
Member
Posts: 37
Joined: Fri Jan 14, 2011 12:25 pm
Location: Germany

Re: Error in Node.js Scripting within Switch

Post 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.
Post Reply