小编JBa*_*zer的帖子

Openshift(node.js)无法安装jsdom

已经使用Openshift/Node.Js一段时间了,大部分都没有问题.通常我安装(通过npm)模块到我的本地(windows)机器,开发,而不是git-deploy到Openshift,一切顺利.

我最近添加了jsdom模块(在本地再次正常工作),但是当我git-deploy(git push没有错误)时,我在尝试使用我的应用程序时出现此错误:

.../app-root/runtime/repo/node_modules/jsdom/node_modules/contextify/node_modules/bindings/bindings.js:91
throw err
^
Error: Could not locate the bindings file.
Run Code Online (Sandbox Code Playgroud)

接下来是Node尝试查找的目录列表.当我检查远程服务器上的这些目录时,它们会丢失(即使它们存在于我的本地计算机上并被推送).如果我尝试通过ftp复制文件夹,我收到此错误:

无效的ELF标头

我理解的是因为contextify模块没有在服务器上构建(即,我复制了它).

请注意,我的package.json中的依赖项包含"jsdom":"0.1.7".

经过一些谷歌搜索,我接下来尝试通过npm在远程服务器上手动安装模块.这产生了以下错误:

npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/combined-stream
npm http 304 https://registry.npmjs.org/async

> contextify@0.1.7 install /var/lib/openshift/52...52/nodejs/node_modules/jsdom/node_modules/contextify
> node-gyp rebuild

npm http GET https://registry.npmjs.org/assert-plus/0.1.2
npm http GET https://registry.npmjs.org/asn1/0.1.11
npm http GET https://registry.npmjs.org/ctype/0.5.2
npm http 304 https://registry.npmjs.org/ctype/0.5.2
npm http 304 https://registry.npmjs.org/assert-plus/0.1.2
npm http 304 https://registry.npmjs.org/asn1/0.1.11
Traceback (most recent call last):
  File "/opt/rh/nodejs010/root/usr/bin/gyp", line 15, in <module>
    import gyp
ImportError: No module named gyp …
Run Code Online (Sandbox Code Playgroud)

node.js openshift

5
推荐指数
1
解决办法
755
查看次数

标签 统计

node.js ×1

openshift ×1