如何使用 npm 在 64 位系统上构建 32 位二进制文​​件? [英] How do I build 32-bit binaries on a 64-bit system using npm?

查看:30
本文介绍了如何使用 npm 在 64 位系统上构建 32 位二进制文​​件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个我计划使用 node-webkit 分发的应用程序,它只在 Windows 上有 32 位二进制文​​件.我的操作系统是 Windows 7 Ultimate 64 位,所以 npm 正在构建 protobuf for node,这是我正在使用的模块之一的先决条件.

I'm developing an application that I plan to distribute using node-webkit, which only has 32-bit binaries on Windows. My OS is Windows 7 Ultimate 64-bit, so npm is building 64-bit binaries of protobuf for node, which is a prerequisite of one of the modules I am using.

我试过了:

  • npm install protobuf --arch=ia32
  • npm 安装 protobuf --target_arch=ia32
  • npm 设置 npm_config_arch ia32
  • 安装 32 位版本的 node 和 npm 并使用它来安装 protobuf

还有一些我暂时想不起来的事情.

And a few other things that I can't remember at the moment.

如何让 npm 构建 32 位二进制文​​件?我是否必须在 32 位机器上构建它?

How can I get npm to build 32-bit binaries? Would I have to build it on a 32-bit machine?

推荐答案

您应该能够自己将 repo 克隆到 node_modules 中并使用

You should be able to clone the repo into node_modules yourself and compile it manually using

node-gyp clean configure build --verbose --arch=ia32

在您克隆 repo 的目录中.

inside the directory where you cloned the repo.

这篇关于如何使用 npm 在 64 位系统上构建 32 位二进制文​​件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆