[英]node version error while pushing to Git repository
將我的更新推送到git存儲庫時出現此錯誤。
一些可能的問題:
- Node version not specified in package.json
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
錯誤:作業失敗:退出代碼134
我正在使用git push origin master
我以前用過的
這是mu pakage json文件
"name": "lc-portal",
"version": "1.0.0",
"description": "MY APP",
"main": "server/start.js",
"scripts": {
"start": "nodemon --watch server -e js,html server/start.js",
"postinstall": "gulp build"
}
為什么我突然收到此錯誤,無法為此解決相關問題。
您需要添加節點版本
"engines": {
"node": "10.x"
},
用您的版本替換“ 10.x”。
您的package.json
文件應類似於
{
"name": "lc-portal",
"version": "1.0.0",
"description": "MY APP",
"main": "server/start.js",
"scripts": {
"start": "nodemon --watch server -e js,html server/start.js",
"postinstall": "gulp build"
},
"engines": {
"node": "your_node_version"
}
}
遵循heroku文檔
我認為您可以使用“引擎”字段:
{ "engines" : { "node" : ">=8" } }
如果您的代碼絕對不能與任何較低版本一起使用,則您可能也需要“ engineStrict”標志:
{ "engineStrict" : true }
可在npmjs網站上找到package.json文件的文檔
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.