I have a working app run locally in node.js and for deployment, I signed up on Heroku and have connected GitHub to Heroku. But when Igit pushand
ran theapp, it says:
Application error. An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
Then, I went to Heroku from the web browser and under "Manual deploy", I click "Deploy Branch" and get this list of errors:
----->Node.js app detected
----->Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false----->Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
engines.yarn (package.json): unspecified (use default)Resolving node version 10.x...Downloading and installing node 10.15.1...Usingdefault npm version:6.4.1Resolving yarn version 1.x...Downloading and installing yarn (1.14.0)...Installed yarn 1.14.0----->Building dependencies
Installing node modules (yarn.lock)
yarn install v1.14.0[1/4]Resolving packages...
error Your lockfile needs to be updated, but yarn was run with`--frozen-lockfile`.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.----->Build failed
!OutdatedYarn lockfile
Your application contains a Yarn lockfile (yarn.lock) which does not
match the dependencies in package.json.This can happen if you use npm
to install or update a dependency instead of Yarn.Please run the following command in your application directory and check
in the new yarn.lock file:
$ yarn install
$ git add yarn.lock
$ git commit -m "Updated Yarn lockfile"
$ git push heroku master
https://kb.heroku.com/why-is-my-node-js-build-failing-because-of-an-outdated-yarn-lockfile!Push rejected, failed to compile Node.js app.!Push failed
I don't think i have yarn but the error did mentioned yarn.
According to your description and error message, it says you have used 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.
I suggest you could firstly check your package.json to make sure you have used the yarn.
If you used it, I suggest you could run yarn install and check in the updated yarn.lock file.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
468 Points
820 Posts
Outdated yarn lockfile error on deploying app on heroku
Feb 07, 2019 09:17 AM|ngaisteve1|LINK
I have a working app run locally in node.js and for deployment, I signed up on Heroku and have connected GitHub to Heroku. But when I
git push
and ran the app, it says:Application error. An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
Then, I went to Heroku from the web browser and under "Manual deploy", I click "Deploy Branch" and get this list of errors:
I don't think i have yarn but the error did mentioned yarn.
Star
9831 Points
3120 Posts
Re: Outdated yarn lockfile error on deploying app on heroku
Feb 08, 2019 02:14 AM|Brando ZWZ|LINK
Hi ngaisteve1,
According to your description and error message, it says you have used 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.
I suggest you could firstly check your package.json to make sure you have used the yarn.
If you used it, I suggest you could run yarn install and check in the updated yarn.lock file.
Besides, since this issue is mainly related with the node.js and heroku, I suggest you could post this issue on below forum.
https://stackoverflow.com/questions/tagged/node.js
Best Regards,
Brando