我正在设置一个离子项目并在 运行 命令 npm install 时收到这些错误

I'm setting up an ionic project and getting these errors when run the command npm install

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:149:21)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd E:\test-proj\Angular\ionic-test\node_modules\ed25519
gyp ERR! node -v v10.0.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

您的问题是关于 python,而不是节点或 angular。有很多关于python路径问题的问题,比如:

https://github.com/iost-official/explorer/issues/1

https://hisk.io/how-to-fix-node-js-gyp-err-cant-find-python-executable-python-on-windows/

我安装了 windows 构建工具,它解决了我的问题。