Why isn't quasar "build" a known command?

Viewed 3970

I'm running quasar build in my bitbucket pipeline but the output is: Error Unknown command "build"

Anybody know why this happens? I basically want to just push my code and let bitbucket pipeline take care of the rest.

image: node:10.15.3

pipelines:
  branches:
      master:
        - step:
          name: Building Quasar
          caches:
              - node
          script:
              - yarn global add @quasar/cli
              - quasar build
              - do some other stuff
          artifacts:
              - path/to/artifact
    - step:
          name: Deploying to S3
          caches:
            - node
          script:
              - cp $BITBUCKET_CLONE_DIR/path/to/artifact path/to/artifact
              - pipe: atlassian/aws-s3-deploy:0.3.8
                variables:
                  ...
4 Answers

It's a common mistakes that occurred during getting packages with package manager. In default yarn package manager doesn't get dev dependencies if NODE_ENV set to production. You have 3 solutions:

  1. move all packages from dev dependencies to dependencies(that is not rational).
  2. Set NODE_ENV to development.
  3. Run Yarn install --production=false when you want to get all dependencies.

May happen if node_modules is not updated for that project. Run "npm install" or the equivalent for yarn. Below is a snapshot of my package.json for a project at this point in time.

  "dependencies": {
    "@quasar/extras": "^1.0.0",
    "axios": "^0.21.1",
    "core-js": "^3.6.5",
    "quasar": "^2.0.0",
    "vue-i18n": "^9.0.0",
    "vuex": "^4.0.1"
  },
  "devDependencies": {
    "@babel/eslint-parser": "^7.13.14",
    "@quasar/app": "^3.0.0",
    "@types/node": "^12.20.21",
    "@typescript-eslint/eslint-plugin": "^4.16.1",
    "@typescript-eslint/parser": "^4.16.1",
    "eslint": "^7.14.0",
    "eslint-config-prettier": "^8.1.0",
    "eslint-plugin-vue": "^7.0.0",
    "workbox-webpack-plugin": "^6.4.2"
  }

I hit this problem after updating my Quasar project (and migrating to Vite). My @quasar/cli utility was installed globally, and therefore it wasn't updated along with the remaining packages managed by Yarn. The solution was simple:

npm update -g @quasar/cli
Related