jsoncrack.com icon indicating copy to clipboard operation
jsoncrack.com copied to clipboard

npm install fail due to `sentry-cli`

Open antoniovalentini opened this issue 3 years ago • 3 comments

Issue description

Steps to reproduce:

  1. clone the repo locally
  2. run npm install --legacy-peer-deps
  3. installation fails with error
npm ERR! code 1
npm ERR! path /home/home_user/projects/jsoncrack.com/node_modules/@sentry/cli
npm ERR! command failed
npm ERR! command sh -c node ./scripts/install.js

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/${USER}/.npm/_logs/2022-09-18T21_22_27_667Z-debug-0.log

Logs:

414 info run @sentry/[email protected] install node_modules/@sentry/cli node ./scripts/install.js
415 info run @sentry/[email protected] install { code: 1, signal: null }
416 timing reify:rollback:createSparse Completed in 99ms
417 timing reify:rollback:retireShallow Completed in 1ms
418 timing command:install Completed in 2260ms
419 verbose stack Error: command failed
419 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
419 verbose stack     at ChildProcess.emit (node:events:513:28)
419 verbose stack     at maybeClose (node:internal/child_process:1093:16)
419 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
420 verbose pkgid @sentry/[email protected]
421 verbose cwd /home/home_user/projects/jsoncrack.com
422 verbose Linux 5.15.0-46-generic
423 verbose argv "/snap/node/6619/bin/node" "/usr/local/bin/npm" "install" "--legacy-peer-deps"
424 verbose node v16.17.0
425 verbose npm  v8.3.2
426 error code 1
427 error path /home/home_user/projects/jsoncrack.com/node_modules/@sentry/cli
428 error command failed
429 error command sh -c node ./scripts/install.js
430 verbose exit 1

Temp fix

Remove @sentry/nextjs dependency from the package.json file and comment out sentry references inside ./src/pages/_app.tsx.

Operating system

  • OS: Ubuntu 20.04.5 LTS
  • node: v16.17.0
  • npm: v8.3.2

Priority this issue should have

Low (slightly annoying)

antoniovalentini avatar Sep 18 '22 21:09 antoniovalentini

I recommend using yarn install instead. Please try it and let me know if it works for you.

AykutSarac avatar Sep 19 '22 18:09 AykutSarac

Just tried and yarn install returns an error too, BUT, it makes npm install work for some reason. So basically:

  • $ npm install --legacy-peer-deps :x:
  • $ yarn install :x:
  • $ npm install --legacy-peer-deps :heavy_check_mark:

But then I get an error when running $ npm run dev (even though the editor manages to boot properly).

Not really sure at this point, my environment may also be messed up. But I'm happy that I can least run the editor so, if I'm the only one experiencing this error I can close the issue.

This project is amazing. Thank you for your effort!

Complete logs

$ npm install --legacy-peer-deps
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
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]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: This package is no longer maintained. Please use @use-gesture/react instead
npm WARN deprecated [email protected]: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated [email protected]: core-js-pure@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js-pure.
npm ERR! code 1
npm ERR! path /home/home_user/projects/jsoncrack.com/node_modules/@sentry/cli
npm ERR! command failed
npm ERR! command sh -c node ./scripts/install.js

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/home_user/.npm/_logs/2022-09-22T20_59_34_183Z-debug-0.log
-----------------------
$ yarn install
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > @monaco-editor/[email protected]" has unmet peer dependency "monaco-editor@>= 0.25.0 < 1".
warning "@monaco-editor/react > @monaco-editor/[email protected]" has unmet peer dependency "monaco-editor@>= 0.21.0 < 1".
warning "@sentry/nextjs > [email protected]" has unmet peer dependency "@babel/preset-env@^7.1.6".
warning "react-hot-toast > [email protected]" has unmet peer dependency "csstype@^3.0.10".
warning " > [email protected]" has incorrect peer dependency "react@^17.0.2".
warning " > [email protected]" has incorrect peer dependency "react-dom@^17.0.2".
warning "reaflow > rdk > [email protected]" has incorrect peer dependency "react@^16.3.0".
warning " > [email protected]" has unmet peer dependency "react-is@>= 16.8.0".
warning " > @testing-library/[email protected]" has unmet peer dependency "@testing-library/dom@>=7.21.4".
warning " > [email protected]" has unmet peer dependency "@babel/core@^7.8.0".
warning "babel-jest > [email protected]" has unmet peer dependency "@babel/core@^7.0.0".
warning "babel-jest > babel-preset-jest > [email protected]" has unmet peer dependency "@babel/core@^7.0.0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "next-pwa > [email protected]" has unmet peer dependency "@babel/core@^7.0.0".
warning "next-pwa > [email protected]" has unmet peer dependency "webpack@>=2".
warning "next-pwa > [email protected]" has unmet peer dependency "webpack@>=4.0.0 <6.0.0".
warning "next-pwa > [email protected]" has unmet peer dependency "webpack@^5.1.0".
warning "next-pwa > [email protected]" has unmet peer dependency "webpack@^4.4.0 || ^5.9.0".
[4/4] Building fresh packages...
[1/3] ⠄ @sentry/cli
[2/3] ⠄ styled-components
error /home/home_user/projects/jsoncrack.com/node_modules/@sentry/cli: Command failed.
Exit code: 1
Command: node ./scripts/install.js
Arguments: 
Directory: /home/home_user/projects/jsoncrack.com/node_modules/@sentry/cli
Output:

-----------------------
$ npm install --legacy-peer-deps

removed 131 packages, changed 9 packages, and audited 1434 packages in 3s

151 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
-----------------------
$ npm run dev

> [email protected] dev
> next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Loaded env from /home/home_user/projects/jsoncrack.com/.env.development
Defining routes from exportPathMap
> [PWA] PWA support is disabled
> [PWA] PWA support is disabled
warn  - Found lockfile missing swc dependencies, patching...
error - Failed to patch lockfile, please try uninstalling and reinstalling next in this workspace
TypeError: Only absolute URLs are supported
    at getNodeRequestOptions (/home/home_user/projects/jsoncrack.com/node_modules/next/dist/compiled/node-fetch/index.js:1:63531)
    at /home/home_user/projects/jsoncrack.com/node_modules/next/dist/compiled/node-fetch/index.js:1:65062
    at new Promise (<anonymous>)
    at Function.fetch [as default] (/home/home_user/projects/jsoncrack.com/node_modules/next/dist/compiled/node-fetch/index.js:1:64996)
    at fetchWithAgent (/home/home_user/projects/jsoncrack.com/node_modules/next/dist/server/node-polyfill-fetch.js:53:39)
    at fetchPkgInfo (/home/home_user/projects/jsoncrack.com/node_modules/next/dist/lib/patch-incorrect-lockfile.js:72:23)
    at /home/home_user/projects/jsoncrack.com/node_modules/next/dist/lib/patch-incorrect-lockfile.js:168:70
    at Array.map (<anonymous>)
    at Object.patchIncorrectLockfile (/home/home_user/projects/jsoncrack.com/node_modules/next/dist/lib/patch-incorrect-lockfile.js:168:59)

antoniovalentini avatar Sep 22 '22 21:09 antoniovalentini

Deleting the newly created package-lock.json solves the issue error - Failed to patch lockfile, please try uninstalling and reinstalling next in this workspace when running npm run dev.

antoniovalentini avatar Sep 22 '22 21:09 antoniovalentini

using sudo yarn install , need more system authority

ENothing avatar Oct 28 '22 13:10 ENothing