我已经建立了一个小型 Python 项目,它构建了一些文档并使用 Travis CI 对其进行测试。 .
现在我想在我的项目中添加一个英文 linter,但我发现看起来有趣的是 Node.js。
有没有办法从 Python 脚本调用 Node.js 包?或者从为 Python 配置的 Travis YAML 文件调用 Node.js 包?
最佳答案
事实证明,您可以直接从 Travis 调用 Node.js:
language: python
branches:
only:
- master
python:
- '2.7'
before_install:
- wget https://raw.githubusercontent.com/creationix/nvm/v0.31.0/nvm.sh -O ~/.nvm/nvm.sh
- source ~/.nvm/nvm.sh
- nvm install 5 # For Node.js v5
- node --version
install:
- pip install -U pip
- pip install -r requirements.txt
- npm install ...
script:
- make ...
- call npm stuff here
关于node.js - 如何从 Python 调用 Node.js 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45101440/