【问题标题】:cannot find module '../package' on install shiny-server from source从源代码安装闪亮服务器时找不到模块'../package'
【发布时间】:2014-03-19 21:22:33
【问题描述】:

我在安装shiny-server (R) 时遇到问题。按照https://github.com/rstudio/shiny-server/wiki/Building-Shiny-Server-from-Source 的安装说明进行操作时,在倒数第二步

(cd .. && ext/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js --python="$PYTHON" rebuild)

我收到以下错误:

node.js:134
    throw e; // process.nextTick error, or 'error' event on first tick
    ^
Error: Cannot find module '../package'
    at Function._resolveFilename (module.js:317:11)
    at Function._load (module.js:262:25)
    at require (module.js:346:19)
    at Object.<anonymous> (/store/opt/shiny-server/ext/node/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js:78:17)
    at Module._compile (module.js:402:26)
    at Object..js (module.js:408:10)
    at Module.load (module.js:334:31)
    at Function._load (module.js:293:12)
    at require (module.js:346:19)
    at Object.<anonymous> (/store/opt/shiny-server/ext/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js:13:11)

有什么建议可以解决这个问题吗?

更新:我使用的是 Ubuntu 11.10,所以我不能只安装预编译版本

【问题讨论】:

  • Ubuntu 11.10,所以我不能使用预编译版本

标签: r node.js ubuntu shiny-server


【解决方案1】:

看到答案是你没有所有的构建必需品。
所以你需要安装以下东西:

  • 蟒蛇
  • cmake
  • 海合会
  • g++
  • 混帐

这里是更多信息的文档。


具体到你提到的错误:

(cd .. && ext/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js --python="$PYTHON" 重建)

未安装 Python 或未设置环境$PYTHON
并确保您安装了 python 2.x(真的。3.x 将无法工作)

【讨论】:

  • Python、gcc、g++和git都是定期安装的(可执行文件可以在/usr/bin找到),cmake安装在/opt/cmake-2.8.12.2/因为预编译版本可用'apt-get install' 不够新,无法用于此安装。但是,cmake 没有添加到 PATH 变量中
  • which pythonwhich python2 的输出是什么
  • /usr/bin/python,版本为Python 2.7.2+
  • $PYTHON 也已设置(如 /usr/bin/python),但我找不到 python2
  • 和 $PYTHON --version 正在工作(并提供 Python 2.7.2+ 作为输出)
猜你喜欢
  • 2015-05-04
  • 2018-04-21
  • 2016-09-19
  • 1970-01-01
  • 2018-07-20
  • 2021-04-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多