Heroku构建失败

时间:2020-10-12 08:12:03

标签: javascript node.js git heroku

我正在尝试使用heroku部署应用程序。当我尝试进行git push时,出现以下错误。

remote: SyntaxError: Unexpected token ...
remote:     at createScript (vm.js:74:10)
remote:     at Object.runInThisContext (vm.js:116:10)
remote:     at Module._compile (module.js:533:28)
remote:     at Object.Module._extensions..js (module.js:580:10)
remote:     at Module.load (module.js:503:32)
remote:     at tryModuleLoad (module.js:466:12)
remote:     at Function.Module._load (module.js:458:3)
remote:     at Module.require (module.js:513:17)
remote:     at require (internal/module.js:11:18)
remote:     at Object.<anonymous> (/tmp/build_d8cae370/node_modules/react-scripts/scripts/build.js:38:23)

这是来自udemy教程,并且提供了一些解决此错误的说明。

  1. 在客户端和服务器上删除package-lock.json文件
  2. 请确保您至少在本地使用LTS版本的Node
  3. 确保您的本地Node版本与package.json文件的engines属性中显示的版本匹配。
  4. 运行git add。 ,git commit -m“修复版本”和git推送heroku主命令以强制重建。

我的本​​地节点版本为 v14.13.0 ,而我的package.json引擎如下。

 ***"main": "index.js",
    "engines": {
            "node": "8.1.1",
            "npm": "5.0.3"***

请您协助解决此问题。谢谢。

0 个答案:

没有答案