【问题标题】:libxmljs: scons command not foundlibxmljs:未找到 scons 命令
【发布时间】:2015-04-12 08:10:28
【问题描述】:

当我尝试部署我的 node.js 应用程序(同时使用 nodejitsu 和 heroku)时,我遇到了与 libxmljs 相同的错误。

> libxmljs@0.4.1 preinstall /root/tmp/tmp-31613c7bs0y8/build/package/node_modules/twilio/node_modules/libxmljs
> make node

make: scons: Command not found
make: *** [node] Error 127
npm http 200 https://registry.nodejitsu.com/css-stringify
npm http 200 https://registry.nodejitsu.com/css-parse
npm http 200 https://registry.nodejitsu.com/is-promise/-/is-promise-1.0.1.tgz

> libxmljs@0.4.1 preuninstall /root/tmp/tmp-31613c7bs0y8/build/package/node_modules/twilio/node_modules/libxmljs
> make clean

make: scons: Command not found
make: *** [clean] Error 127
npm http GET https://registry.nodejitsu.com/css-stringify/-/css-stringify-1.0.5.tgz
npm http GET https://registry.nodejitsu.com/css-parse/-/css-parse-1.0.4.tgz
npm WARN continuing anyway libxmljs@0.4.1 preuninstall: `make clean`
npm WARN continuing anyway Exit status 2
npm ERR! libxmljs@0.4.1 preinstall: `make node`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the libxmljs@0.4.1 preinstall script.
npm ERR! This is most likely a problem with the libxmljs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     make node
npm ERR! You can get their info via:
npm ERR!     npm owner ls libxmljs
npm ERR! There is likely additional logging output above.

npm ERR! System SunOS 5.11
npm ERR! command "node" "/opt/local/bin/npm" "install" "--loglevel=http"
npm ERR! cwd /root/tmp/tmp-31613c7bs0y8/build/package
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE

如您所见,它在 libxmljs 的“make node”和“make clean”中失败,因为找不到命令“scons”。我在我的应用程序的 node_modules 目录中安装了 libxmljs,'scons' 位于“/usr/local/bin/scons”。

我相信我必须确保 scons 的位置在 libxmljs 的 make 环境的路径中,但我不知道该怎么做。任何帮助将不胜感激!

更新:根据这个问题 (Fail to deploy node.js application to heroku) 的建议,我将 libxmljs 添加到 package.json 中的依赖项,并将 node_modules/ 添加到 .gitignore,这样 heroku 可以查看依赖项并自行安装它们。但是,发生了完全相同的错误,这让我相信问题的根源不在于我的本地环境,而是关于 libxmljs 的更大问题?

【问题讨论】:

    标签: node.js makefile scons libxml-js


    【解决方案1】:

    我能够解决我的问题,尽管它并不是专门针对 libxmljs。我还在我的应用程序中使用了“twilio”节点子模块,但在依赖项中将其版本列为“0.0.0”。我猜 twilio 0.0.0 使用了 libxmljs,它在部署到 heroku 时不会安装,所以我将 twilio 版本号更新为实际的当前版本,一切顺利!

    【讨论】:

      猜你喜欢
      • 2015-04-08
      • 1970-01-01
      • 2019-08-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-05
      • 2012-10-31
      • 2015-10-14
      相关资源
      最近更新 更多