Error: "detox-cli" package is not meant to be installed locally, exiting

Viewed 343

I am trying to follow this link to use detox for e2e testing for my react native app. I did it successfully once, but I removed e2e folder, was conducting some experiments, now I am not able to run detox init -r jest every time I run this line it gives me this error:

Error: "detox-cli" package is not meant to be installed locally, exiting...
HINT: Remove the local installation and reinstall it globally:
  npm uninstall detox-cli
  npm install -g detox-cli

I have tried the solution in the hint, but it didn't resolve the issue, any suggestions? If I uninstall and run the command, same error shows up. when I install it, this is what I see (node version and detox-cli version)

/Users/.../.nvm/versions/node/v14.17.0/bin/detox -> /Users/.../.nvm/versions/node/v14.17.0/lib/node_modules/detox-cli/cli.js
+ detox-cli@18.13.0
updated 1 package in 1.358s

-----Update: I just tried this and worked:

/Users/.../.nvm/versions/node/v14.17.0/bin/detox init -r jest
0 Answers
Related