简体   繁体   English

如何确定正在使用哪个版本的NodeJS NPM来构建软件包?

[英]How do I find out which version of NodeJS NPM is using to build packages?

I'm using an npm module called Hummus Renderer . 我正在使用一个名为Hummus Renderer的npm模块。 It installs without any errors, but when I go to use it, I get this message: 它的安装没有任何错误,但是当我使用它时,出现以下消息:

module.js:355
  Module._extensions[extension](this, filename);
                               ^
Error: Module did not self-register.
    at Error (native)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/home/alexb/app/node_modules/hummusrenderer/node_modules/hummus/hummus.js:2:18)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)

All of my Google searches told me to do npm rebuild since switching versions requires the C libraries to be compiled with new bindings. 我所有的Google搜索都告诉我要进行npm rebuild因为切换版本需要使用新的绑定来编译C库。

The only way I can get this module to require is if I switch to Node 0.10.40 . require此模块的唯一方法是切换到Node 0.10.40 My suspicion is that the library is being built with the older bindings for some reason, while the hummus package claims to require Node 0.12.2 . 我怀疑是该库正在构建由于某种原因较旧的绑定,而hummus包声称,要求Node 0.12.2

I have been using hummus for the past s weeks. 在过去的几周里,我一直在使用鹰嘴豆泥。 In my experience, it works fine with any version of Node from 0.10.x to latest 5.10.x 以我的经验,它适用于从0.10.x到最新的5.10.x的任何版本的Node。

Since, hummusjs is a native node module, it is absolutely necessary to use the same node version while installing as well as using the node module. 由于hummusjs是本机节点模块,因此在安装和使用节点模块时绝对必须使用相同的节点版本。 Instead of node rebuild, I would simply prefer deleting the "hummus" folder from "node_modules" and doing an NPM install. 与其重建节点,不如直接从“ node_modules”中删除“ hummus”文件夹并进行NPM安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM