Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Continuous integration Ci中未安装Cypress版本(TravisCI和CircleCI)_Continuous Integration_E2e Testing_Cypress - Fatal编程技术网

Continuous integration Ci中未安装Cypress版本(TravisCI和CircleCI)

Continuous integration Ci中未安装Cypress版本(TravisCI和CircleCI),continuous-integration,e2e-testing,cypress,Continuous Integration,E2e Testing,Cypress,更新到Cypress3.0时,我在CI中遇到此错误,表示未安装Cypress,但在执行Cypress run命令之前,我正在运行npm install。错误: No version of Cypress is installed in: /home/ubuntu/.cache/Cypress/3.0.1/Cypress Please reinstall Cypress by running: cypress install ---------- 为什么Cypress找不到Cypress可

更新到Cypress
3.0
时,我在CI中遇到此错误,表示未安装Cypress,但在执行
Cypress run
命令之前,我正在运行
npm install
。错误:

No version of Cypress is installed in: 

/home/ubuntu/.cache/Cypress/3.0.1/Cypress

Please reinstall Cypress by running: cypress install
----------
为什么Cypress找不到Cypress可执行文件

这是我的
圈。yml

build:
    <<: *defaults
    steps:
      - checkout
      - restore_cache:
          keys:
            - v1-npm-deps
      - run: npm install
      - save_cache:
          key: v1-npm-deps-{{ checksum "package.json" }}
          paths:
            - node_modules
            - ~/.cache
            - ~/.npm
      - run: npm test
      - run: npm run build
      - persist_to_workspace:
          root: /tmp/workspace
          paths:
            - .circleci/deploy.sh
            - .circleci/e2e-test.sh
            - package.json
            - cypress.json
            - node_modules/
            - build/*
            - cypress/*
构建:

这是缓存
node\u模块
的一个小问题-安装Cypress二进制文件的安装后脚本不会运行,因为存在
node\u模块/Cypress

要解决此问题,您可以刷新CI构建的缓存,所有问题都应该解决。 这就是我建议使用的原因,因为每次运行命令时,
node\u模块
都会被擦除

另外: -在Circle CI 2.0中,缓存的工作方式不同于
1.0
TravisCI
,因为缓存是不可变的。您只能创建另一个缓存,而不能销毁和重写缓存。因此,您应该这样做缓存:

- restore_cache:
  keys:
    - v1-deps-{ .Branch }-{ checksum "package.json" }
    - v1-deps-{ .Branch }
    - v1-deps
- run:
  - npm ci
- save_cache:
  key: v1-deps-{ .Branch }-{ checksum "package.json" }
  paths:
    - ~/.cache
    - ~/.npm