npm ERR!gyp ERR!find Python Python不是从命令行或npm配置中设置的



我在这方面坚持了很长时间,检查了几个帖子,但没有解决方案。我正在尝试部署firebase功能。

我已经运行了npm安装-g firebase工具、npm firebase登录、firebaseinit函数,当我安装npm时,我在终端上看到了python的这个问题

npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@16.14.0 | win32 | x64
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
npm ERR! gyp ERR! find Python checking if "python3" can be used
npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python" can be used
npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if Python is C:UsersOsas DivineAppDataLocalProgramsPythonPython39python.exe
npm ERR! gyp ERR! find Python - "C:UsersOsas DivineAppDataLocalProgramsPythonPython39python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:Program FilesPython39python.exe
npm ERR! gyp ERR! find Python - "C:Program FilesPython39python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:UsersOsas DivineAppDataLocalProgramsPythonPython39-32python.exe
npm ERR! gyp ERR! find Python - "C:UsersOsas DivineAppDataLocalProgramsPythonPython39-32python.exe" could not be run

我已经从我的电脑上删除了python,我只想部署firebase,但这些错误令人困惑,没有进展,我不需要python,我如何阻止终端运行它

这是我的包.json

{
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"lint": "eslint .",
"serve": "firebase serve --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"dependencies": {
"firebase-admin": "^9.8.0",
"firebase-functions": "^3.14.1",
"@google-cloud/storage": "^0.4.0",
"sharp": "^0.18.1"
},
"devDependencies": {
"eslint": "^4.12.0",
"eslint-plugin-promise": "^3.6.0"
},
"private": true
}

只需在命令行中键入python即可安装python for windows。

报告的错误是由于操作系统的python安装丢失或不可用。

package.json文件中列出的一个程序包需要python,因此您需要安装适用于Windows的Python,当您准备好时,您必须通过以下方式让节点意识到它的存在:(替换Python安装的文件路径,您可以使用python3或引用的节点程序包所需的路径(:

npm config set python D:LibraryPythonPython27python.exe

最新更新