node.js - 在 TravisCI Deploy 中找不到 eslint
问题描述
我正在尝试使用 TravisCI 将站点部署到 Firebase。当功能部署并尝试运行 lint 时,我一直遇到问题。eslint 似乎不存在,即使我在cd
and中添加了一个命令npm install
。我敢肯定这是不费吹灰之力的。我错过了什么?
这是我的 .travis.yml:
language: node_js
node_js:
- 12
deploy:
provider: firebase
project: "*****"
message: "Deployed from Github by TravisCI"
token:
secure:
*******
env:
global:
secure:
*****
branches:
only:
- master
before_deploy:
- npm install -g gatsby-cli
- rm -rf node_modules/*/.git/
- npm install
- gatsby build
- cd functions && npm install --dev && cd ..
这是 Travis 日志中的错误:
Installing deploy dependencies
dpl.2
Preparing deploy
dpl.3
Deploying application
=== Deploying to 'covid19-reports'...
i deploying storage, firestore, functions, hosting
Running command: npm --prefix "$RESOURCE_DIR" run lint
> functions@ lint /home/travis/build/amygroshek/covid19reports/functions
> eslint .
sh: 1: eslint: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! functions@ lint: `eslint .`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the functions@ lint 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! /home/travis/.npm/_logs/2020-03-23T00_34_17_951Z-debug.log
Error: functions predeploy error: Command terminated with non-zero exit code1
解决方案
推荐阅读
- javascript - 我的谷歌图表 x 轴和 y 轴未正确显示
- c - Qualcomm Hexagon:优化 MAC-loop
- azure - 我可以在 Azure 表存储筛选器中使用请求元数据(例如主机域)吗?
- node.js - 如何从 NodeJS 服务器下载 React 中的文件?(获取文件损坏)
- php - Laravel 在 created_at 等所有模型上添加列值的方法
- dart - dart pub 全局包在 Windows 10 上运行两次
- android - 我使用 Buildbox 制作了一款 Android 游戏,但无法使用 Android Studio 导出它。我有两个软件的最新版本
- android - Cordova 发布应用程序库 - 由于应用程序安装失败而被拒绝
- python - 如何让 pygame 显示我的精灵?
- arrays - 获取 NgFor 项目 Angular 的总数