bnoordhuis / node-iconv

node.js iconv bindings - text recoding for fun and profit!
Other
796 stars 123 forks source link

Compiling in Visual Studio 2013 #78

Closed Lug16 closed 10 years ago

Lug16 commented 10 years ago

Hey! I just want to tell you, I'm running a Win8-64 with just visual studio 2013 Ultimate installed, and when I try to use iconv (npm install iconv) I getting the following error:

iconv@2.0.7 install C:\Users\Lug\Documents\GitHub\node-iconv node-gyp rebuild C:\Users\Lug\Documents\GitHub\node-iconv>node "C:\Program Files\nodejs\node_modu les\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.t argets(64,5): error MSB8020: The build tools for Visual Studio 2012 (Platform T oolset = 'v110') cannot be found. To build using the v110 build tools, please i nstall Visual Studio 2012 build tools. Alternatively, you may upgrade to the c urrent Visual Studio tools by selecting the Project menu or right-click the sol ution, and then selecting "Upgrade Solution...". [C:\Users\Lug\Documents\GitHub \node-iconv\build\iconv.vcxproj] gyp ERR! build error gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe fail ed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\ npm\node_modules\node-gyp\lib\build.js:267:23) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789: 12) gyp ERR! System Windows_NT 6.2.9200 gyp ERR! command "node" "C:\Program Files\nodejs\node_modules\npm\node_modu les\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\Lug\Documents\GitHub\node-iconv gyp ERR! node -v v0.10.22 gyp ERR! node-gyp -v v0.11.0 gyp ERR! not ok

npm ERR! iconv@2.0.7 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the iconv@2.0.7 install script. npm ERR! This is most likely a problem with the iconv package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls iconv npm ERR! There is likely additional logging output above. npm ERR! System Windows_NT 6.2.9200 npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nod ejs\node_modules\npm\bin\npm-cli.js" "install" "--msvs-version=2012" npm ERR! cwd C:\Users\Lug\Documents\GitHub\node-iconv npm ERR! node -v v0.10.22 npm ERR! npm -v 1.3.14 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! C:\Users\Lug\Documents\GitHub\node-iconv\npm-debug.log npm ERR! not ok code 0

Hope you can check that...

Thanks for all

bnoordhuis commented 10 years ago

That's a gyp issue. It tries to auto-detect the VS version but that frequently fails. Try setting GYP_MSVS_VERSION=2013 (or 2013e) in the environment.

paulvandermeijs commented 10 years ago

I've tried npm install iconv --msvs_version=2013e and got this:

npm http GET https://registry.npmjs.org/iconv
npm http 304 https://registry.npmjs.org/iconv

> iconv@2.0.7 install c:\Users\Paul\Workspace\test\node_modules\iconv
> node-gyp rebuild

c:\Users\Paul\Workspace\test\node_modules\iconv>node "c:\Bin\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
Traceback (most recent call last):
  File "c:\Bin\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp", line 18, in <module>
    sys.exit(gyp.main(sys.argv[1:]))
  File "c:\Bin\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 526, in main
    return gyp_main(args)
  File "c:\Bin\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 502, in gyp_main
    options.circular_check)
  File "c:\Bin\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 98, in Load
    generator.CalculateVariables(default_variables, params)
  File "c:\Bin\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1713, in CalculateVariables
    generator_flags.get('msvs_version', 'auto'))
  File "c:\Bin\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSVersion.py", line 366, in SelectVisualStudioVersion
    versions = _DetectVisualStudioVersions(version_map[version], 'e' in version)
KeyError: '2013e'
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (c:\Bin\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:467:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "c:\\Bin\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd c:\Users\Paul\Workspace\test\node_modules\iconv
gyp ERR! node -v v0.10.22
gyp ERR! node-gyp -v v0.11.0
gyp ERR! not ok
npm ERR! iconv@2.0.7 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the iconv@2.0.7 install script.
npm ERR! This is most likely a problem with the iconv package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls iconv
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "c:\\Bin\\nodejs\\node.exe" "c:\\Bin\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "iconv" "--msvs_version=2013e"
npm ERR! cwd c:\Users\Paul\Workspace\test
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     c:\Users\Paul\Workspace\test\npm-debug.log
npm ERR! not ok code 0
bnoordhuis commented 10 years ago

Your copy of npm is too old, you need at least v1.3.15. That's the npm that ships with node v0.10.23.

paulvandermeijs commented 10 years ago

Works, thanks!

daric81 commented 9 years ago

@bnoordhuis This worked for me thanks!

adetunji commented 9 years ago

@bnoordhuis works like a gem (no pun)