Vue CLI 3.0 - azure deploy
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.
I have succeed building Vue with Vue CLI 3 in Azure.
Sharing my build file here
Azure pipeline YAML script
resources:- repo: selftrigger: ['staging']pool: vmImage: 'Ubuntu 16.04'steps:- task: NodeTool@0 displayName: 'Use Node 10.x' inputs: versionSpec: 10.x- script: | npm install npm run build-staging displayName: 'npm install and build' env: NODE_ENV: staging- task: ArchiveFiles@2 displayName: Archive inputs: rootFolderOrFile: '$(build.sourcesDirectory)/dist' includeRootFolder: false archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.SourceVersion)_$(Build.BuildId).zip'- task: PublishBuildArtifacts@1 displayName: 'Publish Artifact: build' inputs: ArtifactName: build
package.json
... "scripts": { "serve": "vue-cli-service serve --port 9001", "build": "vue-cli-service build", "build-staging": "NODE_ENV=production vue-cli-service build --mode staging", "build-production": "NODE_ENV=production vue-cli-service build --mode production", "lint": "vue-cli-service lint" },...