Push rejected, failed to compile Node.js app heroku

前端 未结 8 1024
面向向阳花
面向向阳花 2020-12-09 18:01

When I tried to push my nodejs app to heroku with git push heroku master, i got this:

Counting objects: 975, done.
Delta compression using up to         


        
8条回答
  •  春和景丽
    2020-12-09 18:18

    Issue When you use Yarn to install node modules, it generates a yarn.lock file which contains a list of the exact modules that it installed when you ran the command. If the dependencies in package.json change, but a new yarn.lock file is not generated by the Yarn executable we fail the build to prevent subtle bugs and security issues that could affect your application at runtime.

    Resolution This issue commonly occurs when your application uses Yarn but some other tool modifies the package.json file without invoking yarn install. An example would be using npm to install a new module instead of Yarn, or manually updating a version requirement by hand.

    To resolve this, run yarn install and check in the updated yarn.lock file.

    ensure you have removed package.lock file and commited the same before push.

提交回复
热议问题