try setting the `npm_config_arch` environmental variable to your desired 
architecture when spawning `npm`.

Related Code:
https://github.com/TooTallNate/node-gyp/blob/master/lib/node-gyp.js#L142
https://github.com/TooTallNate/node-gyp/blob/master/lib/configure.js#L235

On Tuesday, August 28, 2012 7:23:11 AM UTC-5, sihorton wrote:
>
> I am on 64bit windows and am able to compile iconv. However I want to 
> distribute the application to run on 32 bit windows. I am able to run the 
> "Windows SDK 7.1 Command Prompt" and set the architecture to x86. However 
> when I then do:
>
> npm install iconv
>
> I get the followng:
>
> >node "C:\Program Files 
> (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js"
>  
> rebuild
> C:\Program Files 
> (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\PlatformToolsets\Windows7.1SDK\Microsoft.Cpp.x64.Windows7.1SDK.targets(20,5):
>  
> error : You are attempting to build an AMD64 application from an x86 
> environment. If using the Windows 7.1 SDK, type setenv /x64 [C:\Program 
> Files (x86)\nodejs\node_modules\iconv\build\iconv.vcxproj]
> gyp ERR! rebuild error Error: `msbuild` failed with exit code: 1
> gyp ERR! rebuild error     at ChildProcess.onExit (C:\Program Files 
> (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:215:23)
>
>
> Looking through the docs it appears that npm is trying to compile the 
> 64bit version of iconv since that is what process.arch returns as the 
> architecture. How do I force npm to build the 32bit version instead?
>
> /Simon
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to