我正在尝试在我的Angular Cli和firebase应用程序中使用circleci。
手动完成所有构建和正确部署。 但是,当我进行circleci部署时,出现以下错误:
/home/circleci/repo/functions/src/index.ts中的错误 [tsl] /home/circleci/repo/functions/src/index.ts(1,28)中的错误 TS2307:找不到模块“ firebase-functions”。 npm ERR!代码ELIFECYCLE npm ERR!错误2 npm ERR! appMy@0.0.0编译:服务器:
webpack --config webpack.server.config.js --progress --colors
npm ERR!退出状态2 npm ERR! npm ERR!失败
这是我的circleci配置文件:
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:10.9.0
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4
working_directory: ~/repo
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: yarn install
- run: yarn add firebase-tools
# Install all needed dependencies from package.json
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- run: npm run build:ssr
- run: cd ./functions && yarn install && cd ../ && cp -a ./dist/. ./functions/dist/
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
# run tests!
#- run: yarn test
#- run: yarn run prod-build
- run: './node_modules/.bin/firebase deploy --only hosting --token=$FirebaseToken'