Pipfile present breaks installation of node dependencies

Hi folks, I’m trying to get started building my Nikola-based site on Netlify. I’m having trouble using both Node and Python with Pipfile.

My first attempt nearly worked: it installed dependencies from my Pipfile (once I’d specified the right Python version) and mostly built the site but then couldn’t find lessc which my theme use to compile my stylesheets. I added less as a dependency using yarn (I’d been using the distribution package locally) and pushed, but then the build process couldn’t find npm so wouldn’t build. Eventually I ripped out Pipfile and replaced it with an equivalent requirements.txt and the build finally works.

This is really annoying because I’d much prefer to use pipenv to manage my Python dependencies. Am I doing something wrong or is this a bug with how the Pipfile is used on the Netlify end?

Cheers,
Jez

I think the second attempt would have worked if one of two things was changed:

  • use npm for the dependency definition not yarn
  • use yarn for the dependency definition and make build commands use yarn not npm

This is based on the following log line:

4:11:58 AM: /usr/local/bin/run-build-functions.sh: line 122: npm: command not found

This is only best guess as I cannot see that repo to confirm. Would you be willing to test using the Pipfile and npm for the lessc dependency (a variation of the second attempt - this time with npm)?

Thanks, I’ve tried removing yarn.json in favour of package.json, and opened up the repository so you can see it: see this branch https://gitlab.com/jezcope/erambler/tree/fix/netlify-npm-pipfile

I tried clearing cache and rebuilding, and the build still fails in the same way: Netlify App

@jezcope, this isn’t a perfect answer but we have a hunch that the python setup you are using is causing the creation of a virtualenv, and we think that in that virtualenv you don’t have access to npm.

It seems like a solution might be to try and find a way to have pipenv not create a virtualenv.