soldair / node-qrcode

qr code generator
MIT License
7.44k stars 619 forks source link

install breaks with node v20.5.1 #352

Open risacher opened 10 months ago

risacher commented 10 months ago

Maybe it's just me?

$ npm install node-qrcode
npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
npm WARN deprecated cryptiles@0.2.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated sntp@0.2.4: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated boom@0.4.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated uuid@2.0.3: 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 node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated request@2.51.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated hoek@0.9.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated hawk@1.1.1: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm ERR! code 1
npm ERR! path /home/magnus/test/node_modules/node-browser
npm ERR! command failed
npm ERR! command sh -c node ./build.js
npm ERR! fs.js:43
npm ERR! } = primordials;
npm ERR!     ^
npm ERR! 
npm ERR! ReferenceError: primordials is not defined
npm ERR!     at fs.js:43:5
npm ERR!     at req_ (/home/magnus/test/node_modules/natives/index.js:143:24)
npm ERR!     at Object.req [as require] (/home/magnus/test/node_modules/natives/index.js:55:10)
npm ERR!     at Object.<anonymous> (/home/magnus/test/node_modules/download/node_modules/graceful-fs/fs.js:1:37)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1233:14)
npm ERR!     at Module._extensions..js (node:internal/modules/cjs/loader:1287:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:1091:32)
npm ERR!     at Module._load (node:internal/modules/cjs/loader:938:12)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:1115:19)
npm ERR!     at require (node:internal/modules/helpers:130:18)
npm ERR! 
npm ERR! Node.js v20.5.1
tienthanh2509 commented 10 months ago

Same for me

 WARN  15 deprecated subdependencies found: boom@0.4.2, cryptiles@0.2.2, graceful-fs@1.2.3, hawk@1.1.1, hoek@0.9.1, minimatch@0.2.14, minimatch@2.0.10, natives@1.1.6, node-uuid@1.4.8, request@2.51.0, rollup-plugin-terser@7.0.2, sntp@0.2.4, sourcemap-codec@1.4.8, uuid@2.0.3, workbox-cacheable-response@6.6.0
Packages: +947
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 969, reused 947, downloaded 0, added 0, done
node_modules/.pnpm/node-browser@0.0.3/node_modules/node-browser: Running inode_modules/.pnpm/node-browser@0.0.3/node_modules/node-browser: Running install script, failed in 107ms
.../node_modules/node-browser install$ node ./build.js
│ fs.js:42
│ } = primordials;
│     ^
│ ReferenceError: primordials is not defined
│     at fs.js:42:5
│     at req_ (/data/workspace/ptstudio-debugger-tools/node_modules/.pn…
│     at Object.req [as require] (/data/workspace/ptstudio-debugger-too…
│     at Object.<anonymous> (/data/workspace/ptstudio-debugger-tools/no…
│     at Module._compile (node:internal/modules/cjs/loader:1155:14)
│     at Object.Module._extensions..js (node:internal/modules/cjs/loade…
│     at Module.load (node:internal/modules/cjs/loader:1033:32)
│     at Function.Module._load (node:internal/modules/cjs/loader:868:12)
│     at Module.require (node:internal/modules/cjs/loader:1057:19)
│     at require (node:internal/modules/cjs/helpers:103:18)
└─ Failed in 107ms at /data/workspace/ptstudio-debugger-tools/node_modules/.pnpm/node-browser@0.0.3/node_modules/node-browser
 ELIFECYCLE  Command failed with exit code 1.
Can-Sahin commented 9 months ago

This npm package is qrcode not 'node-qrcode' ??

stianjensen commented 8 months ago

Yes. node-qrcode is managed in the following repo: https://www.npmjs.com/package/node-qrcode https://github.com/imsobear/node-qrcode

rafaelmaeuer commented 8 months ago

For anyone stumbling across this problem, simply add following resolution to your package.json:

"resolutions": {
  "graceful-fs": "^4.2.11"
}

From: https://stackoverflow.com/questions/55921442/how-to-fix-referenceerror-primordials-is-not-defined-in-node-js/58394828#58394828

But keep in mind, you might be installing the wrong node-qrcode package instead of qrcode!