xmppo / node-expat

libexpat XML SAX parser binding for node.js
https://github.com/xmppo/node-expat
MIT License
385 stars 97 forks source link

node-expat.cc(6): fatal error C1083 when trying to install node-xmpp-bosh #51

Closed geekyme closed 11 years ago

geekyme commented 11 years ago

I tried to solve my problem by looking at similar issues... but I can't find a solution to this problem. Any thoughts? I was trying install node-xmpp-bosh but was told that node-expat fails.

C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-chat>npm install node-xmpp- bosh npm WARN package.json application-name@0.0.1 No README.md file found! npm http GET https://registry.npmjs.org/node-xmpp-bosh npm http 304 https://registry.npmjs.org/node-xmpp-bosh npm http GET https://registry.npmjs.org/node-expat npm http GET https://registry.npmjs.org/ltx npm http GET https://registry.npmjs.org/ws npm http GET https://registry.npmjs.org/tav npm http GET https://registry.npmjs.org/semver npm http GET https://registry.npmjs.org/dns-srv npm http GET https://registry.npmjs.org/node-uuid npm http GET https://registry.npmjs.org/underscore npm http GET https://registry.npmjs.org/eventpipe npm http GET https://registry.npmjs.org/log4js npm http 304 https://registry.npmjs.org/ws npm http 304 https://registry.npmjs.org/tav npm http 304 https://registry.npmjs.org/semver npm http 304 https://registry.npmjs.org/ltx npm http 304 https://registry.npmjs.org/dns-srv npm WARN package.json dns-srv@0.0.6 No README.md file found! npm http 304 https://registry.npmjs.org/node-uuid npm http 304 https://registry.npmjs.org/underscore npm http 304 https://registry.npmjs.org/eventpipe npm http 304 https://registry.npmjs.org/log4js npm http 304 https://registry.npmjs.org/node-expat

node-expat@1.6.1 install C:\Users\shawnlim\Documents\Websites\nodeprojects\fb- chat\node_modules\node-xmpp-bosh\node_modules\node-expat node-gyp rebuild

npm C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-chat\node_modules\node-xmpp -bosh\node_modules\node-expat>node "C:\Program Files\nodejs\node_modules\npm\bin \node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild http GET https://registry.npmjs.org/commander npm http GET https://registry.npmjs.org/tinycolor npm http GET https://registry.npmjs.org/options npm http GET https://registry.npmjs.org/async/0.1.15 npm http 304 https://registry.npmjs.org/options npm http 304 https://registry.npmjs.org/commander npm http 304 https://registry.npmjs.org/tinycolor npm http 304 https://registry.npmjs.org/async/0.1.15

ws@0.4.22 install C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-chat\no de_modules\node-xmpp-bosh\node_modules\ws node install.js

node-expat.cc [ws v0.4.22] Attempting to compile blazing fast native extensions. ..\node-expat.cc(6): fatal error C1083: Cannot open include file: 'expat.h': No such file or directory [C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-c hat\node_modules\node-xmpp-bosh\node_modules\node-expat\build\node_expat.vcxpro j] gyp ERR! build error gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\ npm\node_modules\node-gyp\lib\build.js:219:23) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:96:17) gyp ERR! stack at Process._handle.onexit (child_process.js:678:10) gyp ERR! System Windows_NT 6.1.7600 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\shawnlim\Documents\Websites\nodeprojects\fb-chat\node_modu les\node-xmpp-bosh\node_modules\node-expat gyp ERR! node -v v0.8.11 gyp ERR! node-gyp -v v0.6.11 gyp ERR! not ok [ws v0.4.22] Native code compile failed (but the module will still work): [ws v0.4.22] The native extensions are faster, but not required. [ws v0.4.22] On Windows, native extensions require Visual Studio and Python. [ws v0.4.22] On Unix, native extensions require Python, make and a C++ compiler.

[ws v0.4.22] Start npm with --ws:verbose to show compilation output (if any). npm ERR! node-expat@1.6.1 install: node-gyp rebuild npm ERR! cmd "/c" "node-gyp rebuild" failed with 1 npm ERR! npm ERR! Failed at the node-expat@1.6.1 install script. npm ERR! This is most likely a problem with the node-expat 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 node-expat npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7600 npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nod ejs\node_modules\npm\bin\npm-cli.js" "install" "node-xmpp-bosh" npm ERR! cwd C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-chat npm ERR! node -v v0.8.11 npm ERR! npm -v 1.1.62 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-chat\npm-debug .log npm ERR! not ok code 0

fredericosilva commented 11 years ago

It looks like you don't have the proper dependencies installed, do you have visual studio installed?

geekyme commented 11 years ago

yes i have visual studio 2010, nodegyp, and python 3.3.0

fredericosilva commented 11 years ago

Can you clone node-expat or download the source, run node-gyp rebuild and give us the output?

geekyme commented 11 years ago

Here you go, this is the first time i'm running node-gyp rebuild command, lol hope i done it right....

C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-chat\node_modules>cd node-e xpat

C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-chat\node_modules\node-expa t>node-gyp rebuild gyp info it worked if it ends with ok gyp info using node-gyp@0.7.1 gyp info using node@0.8.11 | win32 | ia32 gyp info spawn C:\Python27\python.exe gyp info spawn args [ 'C:\Users\shawnlim.node-gyp\0.8.11\tools\gyp\gyp',

gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'msvs', gyp info spawn args '-G', gyp info spawn args 'msvs_version=2010', gyp info spawn args '-I', gyp info spawn args 'C:\Users\shawnlim\Documents\Websites\nodeprojects\f b-chat\node_modules\node-expat\build\config.gypi', gyp info spawn args '-I', gyp info spawn args 'C:\Users\shawnlim\AppData\Roaming\npm\node_modules\ \node-gyp\addon.gypi', gyp info spawn args '-I', gyp info spawn args 'C:\Users\shawnlim.node-gyp\0.8.11\common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=C:\Users\shawnlim.node-gyp\0.8.11', gyp info spawn args '-Dmodule_root_dir=C:\Users\shawnlim\Documents\Website s\nodeprojects\fb-chat\node_modules\node-expat', gyp info spawn args '--depth=.', gyp info spawn args '--generator-output', gyp info spawn args 'C:\Users\shawnlim\Documents\Websites\nodeprojects\f b-chat\node_modules\node-expat\build', gyp info spawn args '-Goutput_dir=.' ] gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe gyp info spawn args [ 'build/binding.sln', gyp info spawn args '/clp:Verbosity=minimal', gyp info spawn args '/nologo', gyp info spawn args '/property:TargetExt=.node', gyp info spawn args '/p:Configuration=Release;Platform=Win32' ] xmltok.c xmlrole.c xmlparse.c C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(1152,5): warning MSB8012: TargetExt(.node) does not match the Library's OutputFile prop erty value (.lib). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Lib.OutputFile). [C:\Users\shawnlim\Docu ments\Websites\nodeprojects\fb-chat\node_modules\node-expat\build\deps\libexpat \expat.vcxproj] expat.vcxproj -> C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-chat\no de_modules\node-expat\build\Release\lib\libexpat.lib node-expat.cc ..\node-expat.cc(409): warning C4800: 'int' : forcing value to bool 'true' or ' false' (performance warning) [C:\Users\shawnlim\Documents\Websites\nodeprojects \fb-chat\node_modules\node-expat\build\node_expat.vcxproj] ..\node-expat.cc(422): warning C4800: 'int' : forcing value to bool 'true' or ' false' (performance warning) [C:\Users\shawnlim\Documents\Websites\nodeprojects \fb-chat\node_modules\node-expat\build\node_expat.vcxproj] Creating library C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-chat \node_modules\node-expat\build\Release\node_expat.lib and object C:\Users\sha wnlim\Documents\Websites\nodeprojects\fb-chat\node_modules\node-expat\build\R elease\node_expat.exp Generating code Finished generating code node_expat.vcxproj -> C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-ch at\node_modules\node-expat\build\Release\node_expat.node gyp info ok

fredericosilva commented 11 years ago

It's working.

Does the npm install node-expat also works? You are running a old version of node-gyp, try to update your node version, this will also update npm and node-gyp and maybe fix your problem.

gyp ERR! node -v v0.8.11
gyp ERR! node-gyp -v v0.6.11
geekyme commented 11 years ago

npm install node-expat outputs this:

npm WARN package.json application-name@0.0.1 No README.md file found! npm http GET https://registry.npmjs.org/node-expat npm http 304 https://registry.npmjs.org/node-expat npm ERR! git Appears to be a git repo or submodule. npm ERR! git C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-chat\node_ modules\node-expat npm ERR! git Refusing to remove it. Update manually, npm ERR! git or move it out of the way first.

npm ERR! System Windows_NT 6.1.7600 npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nod ejs\node_modules\npm\bin\npm-cli.js" "install" "node-expat" npm ERR! cwd C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-chat npm ERR! node -v v0.8.11 npm ERR! npm -v 1.1.62 npm ERR! path C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-chat\node_mod ules\node-expat npm ERR! code EISGIT npm ERR! npm ERR! Additional logging details can be found in: npm ERR! C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-chat\npm-debug .log npm ERR! not ok code 0

geekyme commented 11 years ago

hey i updated my node already. check this out, still same error:

C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-chat>npm install node-xmpp- bosh npm WARN package.json application-name@0.0.1 No README.md file found! npm http GET https://registry.npmjs.org/node-xmpp-bosh npm http 304 https://registry.npmjs.org/node-xmpp-bosh npm http GET https://registry.npmjs.org/node-expat npm http GET https://registry.npmjs.org/node-uuid npm http GET https://registry.npmjs.org/ltx npm http GET https://registry.npmjs.org/tav npm http GET https://registry.npmjs.org/underscore npm http GET https://registry.npmjs.org/dns-srv npm http GET https://registry.npmjs.org/eventpipe npm http GET https://registry.npmjs.org/semver npm http GET https://registry.npmjs.org/log4js npm http GET https://registry.npmjs.org/ws npm http 304 https://registry.npmjs.org/node-expat npm http 304 https://registry.npmjs.org/node-uuid npm http 304 https://registry.npmjs.org/underscore npm http 304 https://registry.npmjs.org/ltx npm http 304 https://registry.npmjs.org/dns-srv npm http 304 https://registry.npmjs.org/tav npm http 304 https://registry.npmjs.org/eventpipe npm http 304 https://registry.npmjs.org/semver npm WARN package.json dns-srv@0.0.6 No README.md file found! npm http 304 https://registry.npmjs.org/log4js npm http 304 https://registry.npmjs.org/ws

node-expat@1.6.1 install C:\Users\shawnlim\Documents\Websites\nodeprojects\fb- chat\node_modules\node-xmpp-bosh\node_modules\node-expat node-gyp rebuild

C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-chat\node_modules\node-xmpp -bosh\node_modules\node-expat>node "C:\Program Files\nodejs\node_modules\npm\bin \node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild npm http GET https://registry.npmjs.org/commander npm http GET https://registry.npmjs.org/options npm http GET https://registry.npmjs.org/tinycolor gyp http GET http://nodejs.org/dist/v0.8.14/node-v0.8.14.tar.gz npm http GET https://registry.npmjs.org/async/0.1.15 npm http 304 https://registry.npmjs.org/tinycolor npm http 304 https://registry.npmjs.org/commander npm http 304 https://registry.npmjs.org/options

ws@0.4.22 install C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-chat\no de_modules\node-xmpp-bosh\node_modules\ws node install.js

gyp http 200 http://nodejs.org/dist/v0.8.14/node-v0.8.14.tar.gz [ws v0.4.22] Attempting to compile blazing fast native extensions. npm http 304 https://registry.npmjs.org/async/0.1.15 gyp http GET http://nodejs.org/dist/v0.8.14/node.lib gyp http GET http://nodejs.org/dist/v0.8.14/x64/node.lib gyp http 200 http://nodejs.org/dist/v0.8.14/x64/node.lib gyp http 200 http://nodejs.org/dist/v0.8.14/node.lib node-expat.cc ..\node-expat.cc(6): fatal error C1083: Cannot open include file: 'expat.h': No such file or directory [C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-c hat\node_modules\node-xmpp-bosh\node_modules\node-expat\build\node_expat.vcxpro j] gyp ERR! build error gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\ npm\node_modules\node-gyp\lib\build.js:236:23) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:99:17) gyp ERR! stack at Process._handle.onexit (child_process.js:678:10) gyp ERR! System Windows_NT 6.1.7600 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\shawnlim\Documents\Websites\nodeprojects\fb-chat\node_modu les\node-xmpp-bosh\node_modules\node-expat gyp ERR! node -v v0.8.14 gyp ERR! node-gyp -v v0.7.1 gyp ERR! not ok [ws v0.4.22] Native code compile failed (but the module will still work): [ws v0.4.22] The native extensions are faster, but not required. [ws v0.4.22] On Windows, native extensions require Visual Studio and Python. [ws v0.4.22] On Unix, native extensions require Python, make and a C++ compiler.

[ws v0.4.22] Start npm with --ws:verbose to show compilation output (if any). npm ERR! node-expat@1.6.1 install: node-gyp rebuild npm ERR! cmd "/c" "node-gyp rebuild" failed with 1 npm ERR! npm ERR! Failed at the node-expat@1.6.1 install script. npm ERR! This is most likely a problem with the node-expat 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 node-expat npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7600 npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nod ejs\node_modules\npm\bin\npm-cli.js" "install" "node-xmpp-bosh" npm ERR! cwd C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-chat npm ERR! node -v v0.8.14 npm ERR! npm -v 1.1.65 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-chat\npm-debug .log npm ERR! not ok code 0

fredericosilva commented 11 years ago

Try the npm install node-expat outside of node-expat directory.

fredericosilva commented 11 years ago

node-xmpp-bosh is using the old node-expat@1.6.1 version, update package.json to use the 2.0.0. It compiles here now.

astro commented 11 years ago

Great, can we close this?

geekyme commented 11 years ago

hey how do i force node-xmpp-bosh to use the 2.0.0.

geekyme commented 11 years ago

YAY I GOT IT! love you all seriously!

C:\Users\shawnlim\Documents\Websites\nodeprojects\fb-chat\node_modules\node-xmpp -bosh>node run-server.js +------------------------------------------------------------------------------- -----------------------------------------------------------+ | Starting BOSH server 'v0.6.4' on 'http://0.0.0.0:5280/http-bind/' at 'Mon Oct 29 2012 10:48:27 GMT+0800 (Malay Peninsula Standard Time)' | +------------------------------------------------------------------------------- -----------------------------------------------------------+ +------------------------------------------------------------------------------- --------------------------------------------------+ | Starting WEBSOCKET server 'v0.6.4' on ws://0.0.0.0:5280' at 'Mon Oct 29 2012 1 0:48:27 GMT+0800 (Malay Peninsula Standard Time)' | +------------------------------------------------------------------------------- --------------------------------------------------+