How to install lessc and nodejs in a Python virtualenv?

前端 未结 4 1063
星月不相逢
星月不相逢 2020-12-24 09:52

I would like to install a nodejs script (lessc) into a virtualenv.

How can I do that ?

Thanks

Natim

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-24 10:29

    I like shorrty's answer, he recommended using nodeenv, see: is there an virtual environment for node.js?

    I followed this guide: http://calvinx.com/2013/07/11/python-virtualenv-with-node-environment-via-nodeenv/

    All I had to do myself was:

    . ../bin/activate # switch to my Python virtualenv first
    pip install nodeenv # then install nodeenv (nodeenv==0.7.1 was installed)
    nodeenv --python-virtualenv # Use current python virtualenv
    npm install -g less # install lessc in the virtualenv
    

提交回复
热议问题