Unable to build Appium server since it fails to findNodeInCurrentFileSystem

I am unable to build the Appium Server using this standard line appiumDriverLocalService = AppiumDriverLocalService.buildDefaultService();

I get the following error message

io.appium.java_client.service.local.InvalidServerInstanceException: Invalid server instance exception has occured: There is no installed nodes! Please install node via NPM (https://www.npmjs.com/package/appium#using-node-js) or download and install Appium app (http://appium.io/downloads.html)

    at io.appium.java_client.service.local.AppiumServiceBuilder.findNodeInCurrentFileSystem(AppiumServiceBuilder.java:184)
    at io.appium.java_client.service.local.AppiumServiceBuilder.checkAppiumJS(AppiumServiceBuilder.java:345)
    at io.appium.java_client.service.local.AppiumServiceBuilder.createArgs(AppiumServiceBuilder.java:425)
    at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:358)
    at io.appium.java_client.service.local.AppiumDriverLocalService.buildService(AppiumDriverLocalService.java:86)
    at io.appium.java_client.service.local.AppiumDriverLocalService.buildDefaultService(AppiumDriverLocalService.java:82)
.
.
.
Caused by: java.io.IOException: /Users/deepak/.nvm/versions/node/v12.18.3/lib/node_modules
rm: /tmp/deepak.start.74839: No such file or directory

    at io.appium.java_client.service.local.AppiumServiceBuilder.findNodeInCurrentFileSystem(AppiumServiceBuilder.java:185)
    ... 29 more 

*I have edited a few unnecessary TestNG lines to make it more readable.

I thought this was an issue with my node installation and I have re-installed node and currently the default node version in my local setup (Mac OS) is v14.16.0 . But still I see an IOException for Node version v12.18.3 .

Does anyone have a solution for this? I have been stuck on this problem the whole day

Issue is probably that you are on ‘zsh’, but the installer is built for ‘bash’. You can find out what shell you are using with either of the following commands:

echo $0
echo $SHELL

Take a look here for possible solutions:

If those don’t work, do an internet search for ‘zsh node’.