How to write .travis.yml if my project deps on python and nodejs?

拈花ヽ惹草 提交于 2019-12-01 16:10:41

问题


My project includes some python codes and build with grunt.I write .travis.yml like:

language: node_js
before_install:
  - pip install Django
  - npm install -g grunt-cli
  - npm uninstall grunt # https://github.com/npm/npm/issues/3958
node_js:
  - "0.10" 
python:
  - "2.7"

But that failed: *

OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/Django-1.7.1.dist-info'

*

It seems like I cannot 'pip install' in a 'node_js' project.


回答1:


Instead of using sudo, pass the --user flag into pip (e.g., pip install --user django) to install the package in the home directory. This approach also works in Travis’ container-based infrastructure, which disallows sudo.




回答2:


It's kind of solved.A sudo must be prepend to 'pip install'.

I guess 'npm install -g grunt-cli' does not need sudo because it's a 'node_js' project.Right?



来源:https://stackoverflow.com/questions/27036259/how-to-write-travis-yml-if-my-project-deps-on-python-and-nodejs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!