无法在Windows 10中使用npm安装xml2json模块

无法在Windows 10中使用npm安装xml2json模块,npm,Npm,我试图使用npm安装xml2json,但控制台返回以下错误 我运行npmixml2json 然后,控制台返回此错误 C:\Users\VDSCH\Proyectos\Tossa\problemApp\node_modules\node-expat>if not defined npm_config_node_gyp (node "C:\Users\VDSCH\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\no

我试图使用npm安装xml2json,但控制台返回以下错误

我运行
npmixml2json

然后,控制台返回此错误

C:\Users\VDSCH\Proyectos\Tossa\problemApp\node_modules\node-expat>if not defined npm_config_node_gyp (node "C:\Users\VDSCH\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\VDSCH\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Users\VDSCH\AppData\Local\Programs\Python\Python37-32"", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Users\VDSCH\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\VDSCH\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack     at C:\Users\VDSCH\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:282:31
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:154:21)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\VDSCH\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\VDSCH\Proyectos\Tossa\problemApp\node_modules\node-expat
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN problemapp@1.0.0 No description
npm WARN problemapp@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-expat@2.3.18 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat@2.3.18 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\VDSCH\AppData\Roaming\npm-cache\_logs\2019-06-26T16_59_24_765Z-debug.log
C:\Users\VDSCH\Proyectos\Tossa\problemApp\node\u modules\node expat>如果未定义npm\u config\u node\u gyp(节点“C:\Users\VDSCH\AppData\Roaming\npm\node\u modules\npm\node\u lifecycle\node gyp bin\\\\\..\node\u modules\node gyp.js重建)其他(节点“C:\Users\VDSCH\AppData\Roaming\npm\node\u modules\npm\node\u modules\node gyp\bin\node gyp.js”重建)
gyp错误!配置错误
gyp ERR!堆栈错误:找不到Python可执行文件“C:\Users\VDSCH\AppData\Local\Programs\Python\Python37-32”,您可以设置Python env变量。
哎呀!PythonFinder.failNoPython上的堆栈(C:\Users\VDSCH\AppData\Roaming\npm\node\u modules\npm\node\u modules\node gyp\lib\configure.js:484:19)
哎呀!堆叠在PythonFinder。(C:\Users\VDSCH\AppData\Roaming\npm\node\u modules\npm\node\u modules\node gyp\lib\configure.js:509:16)
哎呀!堆栈位于C:\Users\VDSCH\AppData\Roaming\npm\node\u modules\npm\node\u modules\fs\polyfills.js:282:31
哎呀!堆栈在FSReqWrap.oncomplete(fs.js:154:21)
哎呀!系统Windows\u NT 10.0.17134
哎呀!命令“C:\\Program Files\\nodejs\\node.exe”C:\\Users\\VDSCH\\AppData\\Roaming\\npm\\node\u modules\\npm\\node\u modules\\node gyp\\bin\\node gyp.js“重建”
哎呀!cwd C:\Users\VDSCH\Proyectos\Tossa\problemApp\node\u modules\node expat
哎呀!节点-v10.15.0
哎呀!节点gyp-v3.8.0
哎呀!不好
npm警告problemapp@1.0.0没有描述
npm警告problemapp@1.0.0没有存储库字段。
npm警告可选跳过可选依赖项:fsevents@1.2.9(节点\u模块\fsevents):
npm WARN notsup跳过可选依赖项:不支持的平台fsevents@1.2.9:通缉{“os”:“达尔文”,“拱门”:“任何”}(当前:{“os”:“win32”,“拱门”:“x64”})
npm错误!代码失效循环
npm错误!错误1
npm错误!节点-expat@2.3.18安装:`node gyp rebuild`
npm错误!退出状态1
npm错误!
npm错误!在节点上失败-expat@2.3.18安装脚本。
npm错误!这可能不是npm的问题。上面可能还有其他日志输出。
npm错误!此运行的完整日志可在以下位置找到:
npm错误!C:\Users\VDSCH\AppData\Roaming\npm缓存\\u日志\2019-06-26T16\u 59\u 24\u 765Z-debug.log

最后,我尝试重新安装了node gyp和node expat,但它们似乎不起作用。软件包是否有问题,或者我自己的系统变量是否有遗漏?

错误本身说明找不到
python
可执行文件,并要求您设置
python
环境变量以定位它

因此,第一个问题是,您是否安装了python?如果没有,你应该


然后,在再次运行进程之前,设置
PYTHON
环境变量以定位它。

我已经安装了PYTHON,我是否需要将环境变量设置为可执行文件?设置python环境变量时,它会返回与以前相同的错误。您的环境变量是一直设置到您的
python.exe
(或
python3.exe
或其他)还是仅设置到目录?看起来变量应该一直指向
.exe
。无法在Linux上重现此问题,尽管在
节点gyp发出许多GCC警告和NPM发出一些弃用警告后安装成功。