vuepress用travis-cli持续集成时出现个问题


install.npm

2010.80s$ npm ci 

204

2050.18s$ npm run docs:build

206

207\> newNode@1.0.0 docs:build /home/travis/build/15835196981/newNodeCode

208\> vuepress build docs

209

210sh: 1: vuepress: not found

211npm  ERR!  code ELIFECYCLE

212npm  ERR!  syscall spawn

213npm  ERR!  file sh

214npm  ERR!  errno ENOENT

215npm  ERR! newNode@1.0.0 docs:build: \`vuepress build docs\`

216npm  ERR! spawn ENOENT

217npm  ERR!  

218npm  ERR! Failed at the newNode@1.0.0 docs:build script.

219npm  ERR! This is probably not a problem with npm. There is likely additional logging output above.

220

221npm  ERR! A complete log of this run can be found in:

222npm  ERR! /home/travis/.npm/\_logs/2020-01-26T07\_54\_52\_752Z-debug.log

223The command "npm run docs:build" exited with 1.

cache.2

224store build cache

228

229

230Done. Your build exited with 1.

这个是travis后台提示的错误,怎么安装vuepress呢

阅读 3.4k
1 个回答

自己解决
.travis.yml文件里写上安装vuepress的命令就行了

script:  
  - npm i vuepress # 环境里没有vuepress时需要这一行
  - npm run docs:build # 执行命令
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进