Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vue CLI 3.0 - azure deploy

Tags:

vue.js

azure

I want to deploy my app build in vue which use CLI 3.0.

My package.json:

  "scripts": {
    "serve": "vue-cli-service serve",
    "postinstall": "npm run build",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint",
    "test:unit": "vue-cli-service test:unit",
    "test:e2e": "vue-cli-service test:e2e"
  }

I added "@vue/cli": "^3.0.0-rc.3" to devDependencies, but is don't see any changes.

Azure deploy result:

> npm run vue-cli-service build
npm ERR! missing script: vue-cli-service

Do you have any ideas?

like image 795
Dominik Avatar asked Jul 12 '18 18:07

Dominik


2 Answers

I havent used azure yet, but try only with

npm run build

instead of

npm run vue-cli-service build
like image 109
Gerson E. Aguirre Avatar answered Sep 28 '22 03:09

Gerson E. Aguirre


I assume you have a build pipeline that struggles with the message you have given.

I think what you are missing is a simple

npm install

After the install you are able to run

npm run build

Without the npm install before, threre is no vue-cli-service npm can find to build the application. I build my own vue-cli 3.0 app this way an deploy to azure like this from an Azure DevOps build pipeline.

or an other possibility is that you are missing another dependency. Add "@vue/cli-service": "^3.0.1" to your devDependencies. And as Daniel Gonzalez pointed out in the comments, there is no need for a postinstall script.

like image 29
VSDekar Avatar answered Sep 28 '22 03:09

VSDekar