Getting Error While Launching Appium server Pragmatically but it getting started Manual hitting the command

After trying all the suggestions in this thread , I am still getting the same error.

My Set up is:

  • Mac M1 OS:14.1.2
  • Appium 2.2.2 (/opt/homebrew/lib/node_modules/appium/build//lib/main.js)
  • Java 21.0.1
  • Node v21.2.0
Exception in thread "main" io.appium.java_client.service.local.InvalidServerInstanceException: NodeJS is either not installed or its executable not present in PATH
	at io.appium.java_client.service.local.AppiumServiceBuilder.validatePath(AppiumServiceBuilder.java:127)
	at io.appium.java_client.service.local.AppiumServiceBuilder.findBinary(AppiumServiceBuilder.java:137)
	at io.appium.java_client.service.local.AppiumServiceBuilder.findDefaultExecutable(AppiumServiceBuilder.java:179)
	at io.appium.java_client.service.local.AppiumServiceBuilder.loadSystemProperties(AppiumServiceBuilder.java:407)
	at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:505)
	at AliceTestingEndevours.AppiumCourse.NewAppiumBasics.main(NewAppiumBasics.java:16)

Was following this course.

Whilst I keep looking , Can anyone suggest other things which might work?

Thanks