npm 重建错误:找不到 Python 可执行文件"python"



当我输入命令时:

npm rebuild

我收到此错误:

strong-ursa@0.10.1 install D:appnode_modulesstrong-ursa
node-gyp rebuild
D:appnode_modulesstrong-ursa>if not defined npm_config_node_gyp (node "C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecyclenode-gyp-bin\....node_modulesnode-gypbinnode-gyp.js" rebuild )  else (node "C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js" rebuild )
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 Filesnodejsnode_modulesnpmnode_modulesnode-gyplibconfigure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplibconfigure.js:509:16)
gyp ERR! stack     at C:Program Filesnodejsnode_modulesnpmnode_modulesgraceful-fspolyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd D:appnode_modulesstrong-ursa
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! strong-ursa@0.10.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the strong-ursa@0.10.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

您可以尝试以下方法来解决您的问题:

npm install --global node-gyp

最新更新