How do I build 32-bit binaries on a 64-bit system using npm?

后端 未结 3 1220
我在风中等你
我在风中等你 2021-02-02 17:13

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-

相关标签:
3条回答
  • 2021-02-02 17:40

    Tried the suggestion offered by asherkin and Derrick and suggest the below

    npm set npm_config_arch ia32
    npm clean-install --arch=ia32
    

    The first command is to set the node environment of the project/folder to 32bit. The second command is to reinstall all packages in 32bit.

    0 讨论(0)
  • 2021-02-02 17:41

    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
    

    inside the directory where you cloned the repo.

    0 讨论(0)
  • 2021-02-02 17:47

    Add a file in your project root called .npmrc Windows explorer doesn't allow creation of a file name starting with a dot, but this can be done on windows command line like this:

    type NUL > .npmrc
    

    Then add the following line to the file:

    npm_config_arch=ia32
    

    You may also want to put this line in there to force VS build version, since some packages want to use non-installed versions. Replace 2013 with your version of Visual Studio if different (2012, etc):

    msvs_version=2013
    
    0 讨论(0)
提交回复
热议问题