xmppo / node-expat

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

Could not install on windows 10 #189

Closed ghost closed 1 year ago

ghost commented 6 years ago

The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

UncleGus commented 5 years ago

I have solved this. If you notice this part of the command else (node "" rebuild ) what I think is happening is that it is incorrectly evaluating if not defined npm_config_node_gyp as false and trying to run nothing instead of node-gyp. What you need to do is define your npm_config_node_gyp variable. You can do this like so: export npm_config_node_gyp=<PATH_TO_NODE_GYP_PACKAGE_FOLDER> remember that Windows will need double backslashes. For me, it looked like this: export npm_config_node_gyp=C:\\Users\\781990\\AppData\\Roaming\\nvm\\v6.11.0\\node_modules\\node-gyp

UncleGus commented 5 years ago

There is another step after my fix. When executing my code, the expat bindings were missing. To fix it, add the bin folder and node-gyp executable to the npm_config_node_gyp variable and run node-gyp rebuild in the node_modules\node-expat folder. e.g. export npm_config_node_gyp=C:\\Users\\781990\\AppData\\Roaming\\nvm\\v6.11.0\\node_modules\\node-gyp\\bin\\node-gyp.js cd node_modules\node-expat node-gyp rebuild

kikaendeavor commented 1 year ago

tks and its work for me. what I encountered is that I've installed multiple node versions by nvm. The value of export npm_config_node_gyp should be set with node_gyp based on current node version. like this: export npm_config_node_gyp=E:\\program-files\\nvm\\v14.21.0\\node_modules\\npm\\node_modules\\node-gyp

Attention: node_gyp in npm config should avoid duplicate.