我正在尝试将应用推送到heroku,特别是Discord的机器人。我一直在关注本教程:https://medium.com/davao-js/v2-tutorial-deploy-your-discord-bot-to-heroku-part-2-9a37572d5de4
在开发过程中,我一直无法安装node-gyp。尝试时npm i
不起作用,但是npm i -g node-gyp
起作用,并且我成功安装了node-gyp。但是,当尝试npm install
更新我的package-lock.json文件或尝试git push heroku master
时,我收到相同的错误:
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:310:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
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\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Windows\System32\lemon-cookie-bot
gyp ERR! node -v v12.16.2
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lemon-cookie-bot@1.0.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lemon-cookie-bot@1.0.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
我不确定这是什么意思。我搜索了堆栈错误以及代码ELIFECYCLE
和errno 1
,但没有找到适合我的解决方案。我认为错误完全与重建node-gyp有关,因为尝试推送到heroku时没有其他错误。
我对此还是很陌生的,所以有很多我不完全了解。请彻底回答。