Error installing driver with Appium 2.0

I’m trying the latest Appium 2.0 and I get this error when trying to install individual drivers. Anyone know what the problem is?

✖ Installing 'xcuitest' using NPM install spec 'appium-xcuitest-driver'
Error: Encountered an error when installing package: The package was not downloaded correctly; its package.json did not exist or was unreadable. We looked for it at /Users/<username>/.appium/appium-xcuitest-driver/node_modules/appium-xcuitest-driver/package.json

Sometimes NPM just doesn’t download things correctly. Try again?

rm -rf ~/.appium
appium driver install xcuitest
1 Like

+1
❯ rm -rf ~/.appium

❯ appium driver install xcuitest
Attempting to find and install driver ‘xcuitest’
:heavy_multiplication_x: Installing ‘xcuitest’ using NPM install spec ‘appium-xcuitest-driver’
Error: Encountered an error when installing package: The package was not downloaded correctly; its package.json did not exist or was unreadable. We looked for it at ~/.appium/appium-xcuitest-driver/node_modules/appium-xcuitest-driver/package.json

❯ appium driver install uiautomator2
Attempting to find and install driver ‘uiautomator2’
:heavy_multiplication_x: Installing ‘uiautomator2’ using NPM install spec ‘appium-uiautomator2-driver’
Error: Encountered an error when installing package: Command ‘npm install --no-save --no-package-lock appium-uiautomator2-driver -json’ exited with code 1

Do I need to create package.json manually?

@jlipps I look forward to receiving your update.

Did this work for anyone of you? I tried same steps, but still getting same issue.

@jlipps Thanks a lot it worked.
@Jordi:
Make sure you don’t have any package.json and no node_modules folder in Home directory. and try installing it again with appium driver install command. it should work.

1 Like

Thanks everyone for your replies, had left this on the back burner. removing node_modules worked for me. Looking forward to taking this for a spin.