serverless-next.js icon indicating copy to clipboard operation
serverless-next.js copied to clipboard

Can't install version 3.7.0 - ENOENT: no such file or directory, open './package-lock.json'

Open marcoschicote opened this issue 2 years ago • 2 comments

Issue Summary

Can't install @sls-next/[email protected] on Gitlab CI/CD nor on my personal computer

Actual behavior

entropy:webapp mchicote$ npm install -g @sls-next/[email protected] 
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm notice 
npm notice New minor version of npm available! 8.5.5 -> 8.12.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.12.2
npm notice Run npm install -g [email protected] to update!
npm notice 
npm ERR! code 1
npm ERR! path /usr/local/lib/node_modules/@sls-next/serverless-component/node_modules/aws-crt
npm ERR! command failed
npm ERR! command sh -c npm install npm-force-resolutions && npx npm-force-resolutions && npm install npm-force-resolutions && npx npm-force-resolutions
npm ERR! added 6 packages, and audited 7 packages in 2s
npm ERR! 
npm ERR! found 0 vulnerabilities
npm ERR! Error: ENOENT: no such file or directory, open './package-lock.json'
npm ERR!     at Object.openSync (node:fs:585:3)
npm ERR!     at Object.fs [as readFileSync] (node:fs:453:35)
npm ERR!     at npm_force_resolutions$core$node_slurp (/usr/local/lib/node_modules/npm-force-resolutions/out/npm_force_resolutions/core.cljs:15:20)
npm ERR!     at npm_force_resolutions$core$read_json (/usr/local/lib/node_modules/npm-force-resolutions/out/npm_force_resolutions/core.cljs:22:23)
npm ERR!     at switch__2144__auto__ (/usr/local/lib/node_modules/npm-force-resolutions/out/npm_force_resolutions/core.cljs:151:3)
npm ERR!     at /usr/local/lib/node_modules/npm-force-resolutions/out/npm_force_resolutions/core.cljs:151:3
npm ERR!     at npm_force_resolutions$core$update_package_lock_$_state_machine__2145__auto____1 (/usr/local/lib/node_modules/npm-force-resolutions/out/npm_force_resolutions/core.js:648:4)
npm ERR!     at cljs.core.async.impl.ioc-helpers/FN-IDX (/usr/local/lib/node_modules/npm-force-resolutions/out/npm_force_resolutions/core.js:664:88)
npm ERR!     at cljs.core.async.impl.ioc-helpers/run-state-machine (/usr/local/lib/node_modules/npm-force-resolutions/out/cljs/core/async/impl/ioc_helpers.cljs:35:23)
npm ERR!     at cljs$core$async$impl$ioc_helpers$run_state_machine_wrapped (/usr/local/lib/node_modules/npm-force-resolutions/out/cljs/core/async/impl/ioc_helpers.cljs:39:6)

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mchicote/.npm/_logs/2022-06-22T16_25_56_439Z-debug-0.log

Expected behavior

Installing @sls-next/[email protected] works properly

Steps to reproduce

npm install -g @sls-next/[email protected]

Screenshots/Code/Configuration/Logs

Versions

  • OS/Environment: macOS Monterey. Macbook pro 2018
  • @sls-next/serverless-component version: 3.7.0
  • Next.js version: -

Additional context

I get the same error when running the same command inside Gitlab CI/CD. It also occurred with version 3.7.0-alpha.12. It started happening 5 days ago.

Checklist

  • [x] You have reviewed the README and FAQs, which answers several common questions.
  • [x] You have reviewed our DEBUGGING wiki and have tried your best to include complete information and reproduction steps (including your configuration) as is possible. As there is only one maintainer (who maintains this in his free time) and thus very limited resources, if you have time, please try to debug the issue a bit yourself if possible.
  • [x] You have first tried using the most recent latest or alpha @sls-next/serverless-component release version, which may have already fixed your issue or implemented the feature you are trying to use. Note that the old serverless-next.js component and the serverless-next.js plugin are deprecated and no longer maintained.

marcoschicote avatar Jun 22 '22 16:06 marcoschicote

I think this was fixed after a new release by https://github.com/awslabs/aws-crt-nodejs/releases/tag/v1.12.5 Looks like someone in the dependency chain did not pin something to a specific version.

marcoschicote avatar Jun 24 '22 09:06 marcoschicote

Same issue trying to install 3.6.0. Temporarily fixed it by pointing to a local installation.

igormartimiano avatar Jun 30 '22 21:06 igormartimiano