首页 > 解决方案 > 在 TravisCI Deploy 中找不到 eslint

问题描述

我正在尝试使用 TravisCI 将站点部署到 Firebase。当功能部署并尝试运行 lint 时,我一直遇到问题。eslint 似乎不存在,即使我在cdand中添加了一个命令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

标签: node.jsnpmtravis-cieslint

解决方案


推荐阅读