Adding env variables to vue project triggers vue-cli-service: not found

I’m trying to publish a vue.js project to Pages and whenever I add environment variables I get the following error:

11:59:13.540 sh: 1: vue-cli-service: not found
11:59:13.554 Failed: Error while executing user command. Exited with error code: 127
11:59:13.562 Failed: build command exited with code: 1
11:59:14.607 Failed: error occurred while running build command

If I remove environment variables it publishes. Additionally, the Framework preset keeps reverting to Nuxt.js instead of Vue… which I set

What env are you adding?

That’s fine, it’s just a cosmetic thing.

The env variables are specific to project. They are config settings:


…and I was trying to set for production and preview environments. I’ve since disabled preview.

So I found a solution… I’m not exactly excited by it, but it works. There must be something up with the production branch of my Github repository because I get this issue whenever I try to publish it. I ended up setting the to publish the staging branch whenever Github updates and I manually upload the production branch when I’m ready to publish. On the plus side this enables automatic deploys of the staging branch which should facilitate testing and allows me to have two versions of the site, one staging tied into the Github repo and a prod site.