CircleCI angular 测试失败

CircleCI angular test fails

我正在尝试为 angular 应用程序的 CI/CD 配置 CircleCI。我在 CircleCI 上进行 运行 测试,但它总是失败,并出现我所附图片中的错误。我有点卡住了,因为我以前没有使用过 CirleCI。有人可以帮我看看这个吗?或者我应该提供任何其他应该考虑的信息吗?

提前致谢。

npm info it worked if it ends with ok
npm info using npm@4.2.0
npm info using node@v7.10.1
npm info lifecycle store-frontend@0.0.0~pretest: store-frontend@0.0.0
npm info lifecycle store-frontend@0.0.0~test: store-frontend@0.0.0

> store-frontend@0.0.0 test /home/circleci/project
> ng test --no-watch --no-progress --browsers=ChromeHeadlessCI

/home/circleci/project/node_modules/@angular/cli/bin/ng.js:35
  );
  ^
SyntaxError: Unexpected token )
    at createScript (vm.js:53:10)
    at Object.runInThisContext (vm.js:95:10)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)
    at startup (bootstrap_node.js:151:9)

npm info lifecycle store-frontend@0.0.0~test: Failed to exec test script
npm ERR! Linux 5.13.0-1023-aws
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "test"
npm ERR! node v7.10.1
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! store-frontend@0.0.0 test: `ng test --no-watch --no-progress --browsers=ChromeHeadlessCI`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the store-frontend@0.0.0 test script 'ng test --no-watch --no-progress --browsers=ChromeHeadlessCI'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the store-frontend package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ng test --no-watch --no-progress --browsers=ChromeHeadlessCI
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs store-frontend
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls store-frontend
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/circleci/.npm/_logs/2022-06-03T13_46_32_311Z-debug.log


Exited with code exit status 1

这是我的 config.yml

version: 2.1

orbs: 
  node: circleci/node@5.0.2
  browser-tools: circleci/browser-tools@1.2.3
jobs:
  build:
    docker:
      - image: circleci/node:7.10.1-browsers
    steps:
      - checkout
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          - v1-dependencies-
      - run: npm install
      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}
      - run: npm run test

您的 ng.js 脚本中似乎有错误语法:

/home/circleci/project/node_modules/@angular/cli/bin/ng.js:35
  );
  ^
SyntaxError: Unexpected token )