为什么类星体“构建”不是一个已知的命令?

问题描述 投票:0回答:5

我正在我的 bitbucket 管道中运行

quasar build
,但输出是:错误未知命令“build”

有人知道为什么会发生这种情况吗?我基本上只想推送我的代码,让 bitbucket 管道处理其余的事情。

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:
                  ...
bitbucket-pipelines quasar
5个回答
3
投票

这是使用包管理器获取包时常见的错误。默认情况下,如果 NODE_ENV 设置为生产,yarn 包管理器不会获取开发依赖项。 您有 3 个解决方案:

  1. 将所有包从开发依赖项移至依赖项(这是不合理的)。
  2. 将 NODE_ENV 设置为开发。
  3. 当您想要获取所有依赖项时,运行 Yarn install --product=false。

1
投票

来自 https://forum.quasar-framework.org/topic/5283/unknown-command-build-circleci/5

run: npm install && npm install --only=dev

在我的例子中固定执行如下:

npm install && npm install --only=dev
npm install @quasar/cli
npx quasar build

0
投票

如果该项目的 node_modules 没有更新,则可能会发生这种情况。运行“npm install”或相当于yarn的命令。下面是我此时项目的 package.json 的快照。

  "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"
  }

0
投票

我在更新我的 Quasar 项目(并迁移到 Vite)后遇到了这个问题。我的

@quasar/cli
实用程序是全局安装的,因此它没有与 Yarn 管理的其余包一起更新。解决方案很简单:

npm update -g @quasar/cli

0
投票

我发现你的管道中缺少一些东西:

pipelines:
  branches:
      master:
        - step:
          name: Building Quasar
          caches:
              - node
          script:
              - yarn global add @quasar/cli
              - yarn install --frozen-lockfile # close to `npm ci` required before start building
              - quasar build
              - cd dist/ssr # or any other folder in the dist
              - yarn install --production # now install the dependencies for the built application before deployment
              - do some other stuff
          artifacts:
              - path/to/artifact
最新问题
© www.soinside.com 2019 - 2024. All rights reserved.