Page 1 of 1

Transpile issue

Posted: Mon Dec 11, 2023 4:38 pm
by Mongoose
Hi all

Trying to understand and learn node.js. While trying to create a script using typescript I am having an issue with the transpile command in the terminal - it is giving me this error. What am I doing wrong? Any help much appreciated.

PS C:\Users\switch\Scripts\Node.js\Test> SwitchScriptTool --transpile .
SwitchScriptTool : The term 'SwitchScriptTool' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling
of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ SwitchScriptTool --transpile .
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (SwitchScriptTool:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Re: Transpile issue

Posted: Mon Dec 11, 2023 5:12 pm
by jan_suhr
It can't find it in the PATH variable.
You can write the full path to the SwitchScriptTool at the command or add the path to the PATH variable

Re: Transpile issue

Posted: Tue Dec 12, 2023 11:45 am
by Mongoose
Thanks Jan

It has returned this information which is fine
Usage:
SwitchScriptTool --pack <PathToFolderToPack> <PathToResultFolder> [--password <Password>] [--verbose]
SwitchScriptTool --unpack <PathToSscriptToUnpack> <PathToResultFolder> [--password <Password>]
SwitchScriptTool --create <ScriptID> <PathToResultFolder> [--JavaScript]
The script ID may contain only letters (A-Z, a-z), digits, hyphens and underscores
SwitchScriptTool --generate-translations <PathToScriptFolder> <PathToResultFolder>
SwitchScriptTool --transpile <PathToScriptFolder>
SwitchScriptTool --list <PathToSscript>

When I then follow up with
C:\Users\switch\Desktop\SwitchFolder\Scripts\Folder>SwitchScriptTool --create StringSplitter .

I get this return message
'SwitchScriptTool' is not recognized as an internal or external command,
operable program or batch file.

I have tried a few ideas from the web but no joy. Would you have any idea what this issue is?

Re: Transpile issue

Posted: Tue Dec 12, 2023 1:13 pm
by Mongoose
Hi

For anyone else that may have this issue was able to fix by editing the environment variables and adding the appropriate file path there.

Re: Transpile issue

Posted: Tue Dec 12, 2023 2:17 pm
by jan_suhr
Have you tried it with this path:
C:\Program Files\Enfocus\Enfocus Switch\SwitchScriptTool\SwitchScriptTool --create StringSplitter "C:\Users\switch\Desktop\SwitchFolder\Scripts\Folder"

This should create a folder StringSplitter in C:\Users\switch\Desktop\SwitchFolder\Scripts\Folder and all the files you need to create the script.