3

I am trying to host my app on heroku and when I deploy it using heroku cli or github it gives me following error:

ERROR

-----> Installing dependencies
       Installing node modules
       npm ERR! code EUSAGE
       npm ERR! 
       npm ERR! `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
       npm ERR! 
       npm ERR! Missing: @babel/core@7.18.9 from lock file
       npm ERR! Missing: @ampproject/remapping@2.2.0 from lock file
       npm ERR! Missing: @babel/generator@7.18.9 from lock file
       npm ERR! Missing: @babel/helper-compilation-targets@7.18.9 from lock file
       npm ERR! Missing: @babel/helper-module-transforms@7.18.9 from lock file
       npm ERR! Missing: @babel/helpers@7.18.9 from lock file
       npm ERR! Missing: @babel/parser@7.18.9 from lock file
       npm ERR! Missing: @babel/template@7.18.6 from lock file
       npm ERR! Missing: @babel/traverse@7.18.9 from lock file
       npm ERR! Missing: gensync@1.0.0-beta.2 from lock file
       npm ERR! Missing: json5@2.2.1 from lock file
       npm ERR! Missing: @jridgewell/gen-mapping@0.1.1 from lock file
       npm ERR! Missing: @jridgewell/trace-mapping@0.3.14 from lock file
       npm ERR! Missing: @jridgewell/gen-mapping@0.3.2 from lock file
       npm ERR! Missing: jsesc@2.5.2 from lock file
       npm ERR! Missing: @babel/compat-data@7.18.8 from lock file
       npm ERR! Missing: @babel/helper-validator-option@7.18.6 from lock file
       npm ERR! Missing: @babel/helper-environment-visitor@7.18.9 from lock file
       npm ERR! Missing: @babel/helper-simple-access@7.18.6 from lock file
       npm ERR! Missing: @babel/helper-split-export-declaration@7.18.6 from lock file
       npm ERR! Missing: @babel/helper-function-name@7.18.9 from lock file
       npm ERR! Missing: @babel/helper-hoist-variables@7.18.6 from lock file
       npm ERR! Missing: globals@11.12.0 from lock file
       npm ERR! Missing: @jridgewell/set-array@1.1.2 from lock file
       npm ERR! Missing: @jridgewell/sourcemap-codec@1.4.14 from lock file
       npm ERR! Missing: @jridgewell/resolve-uri@3.1.0 from lock file
       npm ERR! Missing: typescript@4.7.4 from lock file
       npm ERR! 
       npm ERR! Clean install a project
       npm ERR! 
       npm ERR! Usage:
       npm ERR! npm ci
       npm ERR! 
       npm ERR! Options:
       npm ERR! [--no-audit] [--foreground-scripts] [--ignore-scripts]
       npm ERR! [--script-shell <script-shell>]
       npm ERR! 
       npm ERR! aliases: clean-install, ic, install-clean, isntall-clean
       npm ERR! 
       npm ERR! Run "npm help ci" for more info
       
       npm ERR! A complete log of this run can be found in:
       npm ERR!     /tmp/npmcache.wvu98/_logs/2022-07-24T13_15_41_978Z-debug-0.log
-----> Build failed

I tried deleting package-lock.json but it didn't worked. I have also tried npm ci but that too didn't worked for me. I even search on stack overflow but cloud not find similar problem.

Raghav Patel
  • 117
  • 1
  • 11
  • Try running `npm install` locally and committing/pushing the updated lock file. – juliomalves Jul 24 '22 at 20:44
  • Right now I am running into the same issue, have you figured out any solution? – krupal_m Nov 15 '22 at 12:31
  • 1
    @krupal_m Only thing I remember is deleted node_modules folder and other .next folder and all other folders which were created during `yarn dev` or `npm dev` and run `npm install`. Try this I hope this would work. – Raghav Patel Nov 16 '22 at 20:09

1 Answers1

-2

npm i use package.json and create package-lock.json, then npm ci use package-lock.json, so if delete the packeage-lock.json you can't run npm ci, need to run npm i.

If run npm i --legacy-peer-deps must be change npm ci to npm ci --legacy-peer-deps, because my error is this.