【问题标题】:How can I install Grunt an any nitrous.io box如何在任何 nitrous.io 盒子上安装 Grunt
【发布时间】:2014-01-22 15:47:20
【问题描述】:

我正在 Nitrous.io python 盒子上开发一个 python 应用程序,但我正在使用 grunt 来构建前端。如何在 python 盒子上安装 node、grunt 和 bower?

【问题讨论】:

    标签: nitrousio


    【解决方案1】:

    Grunt 需要 Node.JS 版本 >=0.8.0 (source),目前 Nitrous.IO 仅在 Node.JS 模板上提供 Node.JS (source)。

    作为一种解决方法,您可能希望考虑使用 Nitrous.IO 在 Node.JS 模板上构建您的 Python 项目。除了 NPM 和 Node.JS,该模板还包括 Python 2.7.3、pipvirtualenv

    【讨论】:

    • 是的,他们使用的是 ubuntu,它带有 python 2.7。但是当他们切换到 python 3 时它可能会中断。
    • 在 virtualenv 中运行会是一条安全的路线吗?我不确定你建议它可能闯入的场景。可以通过运行 virtualenv -p /usr/bin/python3.3 py3env 来设置 Python 3.x 环境,然后运行 ​​source py3env/bin/activate
    • 我的应用需要 python 2.7 并且 python 2.7 可用,因为 python 2.7 是操作系统默认的 python 版本。但是任何一天盒子操作系统都可以升级,并且可能会丢失 python 2.7。
    • 只需在 Virtualenv 中运行您的项目,以确保您始终使用 2.7。运行 virtualenv -p /usr/bin/python2.7 py27,然后运行 ​​source py27/bin/activate 以使用 Python 2.7 初始化 Virtualenv。
    猜你喜欢
    • 2014-12-12
    • 1970-01-01
    • 1970-01-01
    • 2014-12-31
    • 2023-04-07
    • 1970-01-01
    • 1970-01-01
    • 2014-03-14
    • 1970-01-01
    相关资源
    最近更新 更多