Bitbucket Angular npm сбой сборки при запуске - PullRequest
0 голосов
/ 10 июля 2020

Я пытаюсь настроить конвейер сборки на Bitbucket. Пользуюсь чистым новым проектом Angular. Пока это выглядит так:

- step:
    name: build frontend
    caches:
      - node
    condition:
      changesets:
        includePaths:
          - "frontend/src/deguvino-portal/**"
    image: node:14.5.0
    script:
      - npm install
      - npm install -g @angular/cli          
      - npm install -g npm@latest
      - npm install -g @angular-devkit/build-angular
      - npm run build --prod --prefix ./frontend/src/deguvino-portal/

И он продолжает давать сбой при выполнении команды npm run build с ошибкой

An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json'
Require stack:
- /usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js
- /usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/index.js
- /usr/local/lib/node_modules/@angular/cli/models/architect-command.js
- /usr/local/lib/node_modules/@angular/cli/commands/build-impl.js
- /usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/schematics/tools/export-ref.js
- /usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/schematics/tools/index.js
- /usr/local/lib/node_modules/@angular/cli/utilities/json-schema.js
- /usr/local/lib/node_modules/@angular/cli/models/command-runner.js
- /usr/local/lib/node_modules/@angular/cli/lib/cli/index.js
- /usr/local/lib/node_modules/@angular/cli/lib/init.js
- /usr/local/lib/node_modules/@angular/cli/bin/ng
See "/tmp/ng-nTDaRU/angular-errors.log" for further details.
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! deguvino-portal@0.0.0 build: `ng build`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the deguvino-portal@0.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-07-10T14_51_37_386Z-debug.log

Есть предложения, как я могу это исправить? PS Я использую npm run build, а не ng build, потому что мои источники находятся не в папке root, а в каталоге frontend/src/deguvino-portal/, и я нашел способ указать каталог для ng build.

...