Skip to content
This repository has been archived by the owner on Jan 7, 2021. It is now read-only.

Not able to install npm i xml2json #168

Open
sachinsahu731 opened this issue Nov 22, 2018 · 3 comments
Open

Not able to install npm i xml2json #168

sachinsahu731 opened this issue Nov 22, 2018 · 3 comments

Comments

@sachinsahu731
Copy link

sachinsahu731 commented Nov 22, 2018

PS C:\Users\GoodWorkLabs\Desktop\ecar-batch\js2xml> npm i xml2json
npm WARN deprecated hoek@5.0.4: This version is no longer maintained. Please upgrade to the latest version.

node-expat@2.3.17 install C:\Users\GoodWorkLabs\Desktop\ecar-batch\js2xml\node_modules\node-expat
node-gyp rebuild

C:\Users\GoodWorkLabs\Desktop\ecar-batch\js2xml\node_modules\node-expat>if not defined npm_config_node_gyp (node "C:\Users\GoodWorkLabs\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Warning: Missing input files:
C:\Users\GoodWorkLabs\Desktop\ecar-batch\js2xml\node_modules\node-expat\build\deps\libexpat......\deps\libexpat\version.c
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microso
ft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere. [C:\Users\GoodWorkLabs\Desktop\ecar-ba
tch\js2xml\node_modules\node-expat\build\binding.sln]
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:\Users\GoodWorkLabs\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\GoodWorkLabs\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\GoodWorkLabs\Desktop\ecar-batch\js2xml\node_modules\node-expat
gyp ERR! node -v v6.11.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN ecar-bundle@1.0.0 No description
npm WARN ecar-bundle@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-expat@2.3.17 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat@2.3.17 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\GoodWorkLabs\AppData\Roaming\npm-cache_logs\2018-11-22T09_52_49_439Z-debug.log
PS C:\Users\GoodWorkLabs\Desktop\ecar-batch\js2xml>

node -v -> v6.11.0

@Clement134
Copy link
Contributor

Hello, do you have tried one of the following solutions:

To fix this,

  1. install the .NET Framework 2.0 SDK,
  2. install Microsoft Visual Studio 2005
  3. add the location of the component to the system path if it is installed elsewhere. [C:\Users\GoodWorkLabs\Desktop\ecar-ba
    tch\js2xml\node_modules\node-expat\build\binding.sln]

@UncleGus
Copy link

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
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants