问题
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