0👍
TL;DR: Run npm install
.
vue-cli-service
is provided by the @vue/cli-service
in your devDependencies. Because you don’t specify the package in the npx
command, it fails if it has to look in the registry. Without npx
, your npm
script will look in node_modules/.bin
for vue-cli-service
. You can remove npx
from your npm
scripts and you should see the same results you’re getting now.
The fact that npx
isn’t finding vue-cli-service
indicates that you have not run npm install
. Do that and your npm
scripts should work as is. Without running npm install
, you will certainly run into other issues once you fix this one.
If, for some reason, you want the npm
scripts to work without running npm install
, you can tell npx
where to find the binary in the registry. Change npx vue-cli-service
in your npm
scripts to be npx -p @vue/cli-service vue-cli-service
instead and it should fix this problem. But you will certainly run into other problems. You’ll want npm install
regardless.
But to really get at the root of things, you’ll need to figure out why the difference between WSL and non-WSL environments in your setup. My guess is that you have @vue/cli-service
installed globally somewhere that only WSL finds it in your PATH
but that’s just a guess.