Environment:
Steps to reproduce:
vue create hello-apollo
cd hello-apollo
vue add apollo
? Add example code? Yes
? Add a GraphQL API Server? Yes
? Enable automatic mocking? Yes
? Configure Apollo Engine? No
Error:
Running completion hooks...
ERROR Error: Command failed with exit code 2 (ENOENT):
vue-cli-service apollo:schema:generate
As shown, vue-cli-service exists in ./node_modules/.bin and this is not in my $PATH, as it shouldn't be. The completion hooks tries to run it directly. As soon as I've added ./node_modules/.bin to $PATH, everything worked.
rm -rf node_modules package-lock.json && npm install
rm -rf node_modules package-lock.json && npm install
Worked for me, thanks
Closing for being not related to this repository, and resolved.
Most helpful comment
rm -rf node_modules package-lock.json && npm install