Even with supported Node.js versions like Node.js v12, npm v7 is not currently supported:
$ node --version
v12.21.0
$ npm install -g npm@latest
+ npm@7.6.3
$ npm --version
7.6.3
$ cd balena-cli
$ rm -rf node_modules && npm install
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /Users/paulo/.nvm/versions/node/v12.21.0/bin/node /Users/paulo/.nvm/versions/node/v12.21.0/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/paulo/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit
npm ERR! > resin-discoverable-services@1.2.2 prepublish
npm ERR! > npm test && npm run build
npm ERR!
npm ERR!
npm ERR! > resin-discoverable-services@1.2.2 test
npm ERR! > npm run lint && gulp test
npm ERR!
npm ERR!
npm ERR! > resin-discoverable-services@1.2.2 lint
npm ERR! > resin-lint lib tests gulpfile.coffee
npm ERR!
npm ERR! ⚡ lib/discoverable.coffee
npm ERR! ⚡ #345: Variable "publishedServices" is assigned to but never read.
npm ERR! ⚡ tests/discovery.spec.coffee
npm ERR! ⚡ #11: Variable "be" is assigned to but never read.
npm ERR! ✓ gulpfile.coffee
npm ERR!
npm ERR! ⚡ Warning! » 0 errors and 2 warnings in 3 files
npm ERR!
npm ERR! [14:43:54] Requiring external module coffeescript/register
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN ERESOLVE overriding peer dependency
npm ERR! npm WARN Found: chai@3.5.0
npm ERR! npm WARN node_modules/chai
npm ERR! npm WARN dev chai@"^3.5.0" from the root project
npm ERR! npm WARN 4 more (chai-as-promised, mochainon, chai-as-promised, chai-datetime)
npm ERR! npm WARN
npm ERR! npm WARN Could not resolve dependency:
npm ERR! npm WARN peer chai@"^4.1.2" from chai-string@1.5.0
npm ERR! npm WARN node_modules/chai-string
npm ERR! npm WARN chai-string@"^1.1.2" from mochainon@1.0.0
npm ERR! npm WARN node_modules/mochainon
npm ERR! 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 ERR! npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm ERR! npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm ERR! 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 ERR! npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! npm WARN deprecated json3@3.3.2: Please use the native JSON object instead of JSON 3
npm ERR! npm WARN deprecated formatio@1.1.1: This package is unmaintained. Use @sinonjs/formatio instead
npm ERR! npm WARN deprecated samsam@1.1.2: This package has been deprecated in favour of @sinonjs/samsam
npm ERR! npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm ERR! npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm ERR! npm WARN deprecated resin-lint@1.5.7: resin-lint is deprecated, please use @balena/lint instead
npm ERR! npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm ERR! npm WARN deprecated coffee-script@1.11.1: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm ERR! npm WARN deprecated core-js@2.6.12: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! fs.js:36
npm ERR! } = primordials;
npm ERR! ^
npm ERR!
npm ERR! ReferenceError: primordials is not defined
npm ERR! at fs.js:36:5
npm ERR! at req_ (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/natives/index.js:143:24)
npm ERR! at Object.req [as require] (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/natives/index.js:55:10)
npm ERR! at Object.<anonymous> (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/graceful-fs/fs.js:1:37)
npm ERR! at Module._compile (internal/modules/cjs/loader.js:999:30)
npm ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR! at Module.load (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/coffeescript/lib/coffee-script/register.js:45:36)
npm ERR! at Function.Module._load (internal/modules/cjs/loader.js:708:14)
npm ERR! at Module.require (internal/modules/cjs/loader.js:887:19)
npm ERR! at require (internal/modules/cjs/helpers.js:74:18)
npm ERR! at Object.<anonymous> (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/graceful-fs/graceful-fs.js:3:27)
npm ERR! at Module._compile (internal/modules/cjs/loader.js:999:30)
npm ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR! at Module.load (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/coffeescript/lib/coffee-script/register.js:45:36)
npm ERR! at Function.Module._load (internal/modules/cjs/loader.js:708:14)
npm ERR! at Module.require (internal/modules/cjs/loader.js:887:19)
npm ERR! at require (internal/modules/cjs/helpers.js:74:18)
npm ERR! at Object.<anonymous> (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/vinyl-fs/lib/src/getContents/bufferFile.js:3:10)
npm ERR! at Module._compile (internal/modules/cjs/loader.js:999:30)
npm ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR! at Module.load (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/coffeescript/lib/coffee-script/register.js:45:36)
npm ERR! at Function.Module._load (internal/modules/cjs/loader.js:708:14)
npm ERR! at Module.require (internal/modules/cjs/loader.js:887:19)
npm ERR! at require (internal/modules/cjs/helpers.js:74:18)
npm ERR! at Object.<anonymous> (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/vinyl-fs/lib/src/getContents/index.js:6:18)
npm ERR! at Module._compile (internal/modules/cjs/loader.js:999:30)
npm ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR! at Module.load (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/coffeescript/lib/coffee-script/register.js:45:36)
npm ERR! at Function.Module._load (internal/modules/cjs/loader.js:708:14)
npm ERR! at Module.require (internal/modules/cjs/loader.js:887:19)
npm ERR! at require (internal/modules/cjs/helpers.js:74:18)
npm ERR! at Object.<anonymous> (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/vinyl-fs/lib/src/index.js:8:19)
npm ERR! at Module._compile (internal/modules/cjs/loader.js:999:30)
npm ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR! at Module.load (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/coffeescript/lib/coffee-script/register.js:45:36)
npm ERR! at Function.Module._load (internal/modules/cjs/loader.js:708:14)
npm ERR! at Module.require (internal/modules/cjs/loader.js:887:19)
npm ERR! at require (internal/modules/cjs/helpers.js:74:18)
npm ERR! at Object.<anonymous> (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/vinyl-fs/index.js:4:8)
npm ERR! at Module._compile (internal/modules/cjs/loader.js:999:30)
npm ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR! at Module.load (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/coffeescript/lib/coffee-script/register.js:45:36)
npm ERR! at Function.Module._load (internal/modules/cjs/loader.js:708:14)
npm ERR! at Module.require (internal/modules/cjs/loader.js:887:19)
npm ERR! at require (internal/modules/cjs/helpers.js:74:18)
npm ERR! at Object.<anonymous> (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/gulp/index.js:7:11)
npm ERR! at Module._compile (internal/modules/cjs/loader.js:999:30)
npm ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR! at Module.load (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/coffeescript/lib/coffee-script/register.js:45:36)
npm ERR! at Function.Module._load (internal/modules/cjs/loader.js:708:14)
npm ERR! at Module.require (internal/modules/cjs/loader.js:887:19)
npm ERR! at require (internal/modules/cjs/helpers.js:74:18)
npm ERR! at Object.<anonymous> (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/gulpfile.coffee:1:8)
npm ERR! at Object.<anonymous> (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/gulpfile.coffee:1:1)
npm ERR! at Module._compile (internal/modules/cjs/loader.js:999:30)
npm ERR! at Object.loadFile (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/coffeescript/lib/coffee-script/register.js:16:19)
npm ERR! at Module.load (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/coffeescript/lib/coffee-script/register.js:45:36)
npm ERR! at Function.Module._load (internal/modules/cjs/loader.js:708:14)
npm ERR! at Module.require (internal/modules/cjs/loader.js:887:19)
npm ERR! at require (internal/modules/cjs/helpers.js:74:18)
npm ERR! at Liftoff.handleArguments (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/gulp/bin/gulp.js:116:3)
npm ERR! at Liftoff.execute (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/liftoff/index.js:203:12)
npm ERR! at module.exports (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/flagged-respawn/index.js:51:3)
npm ERR! at Liftoff.<anonymous> (/Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/liftoff/index.js:195:5)
npm ERR! at /Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/liftoff/index.js:165:9
npm ERR! at /Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef/node_modules/v8flags/index.js:93:14
npm ERR! at FSReqCallback.oncomplete (fs.js:156:23)
npm ERR!
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path /Users/paulo/.npm/_cacache/tmp/git-clone-bf38a4ef
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c npm test && npm run build
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR! /Users/paulo/.npm/_logs/2021-03-17T14_43_54_103Z-debug.log
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/paulo/.npm/_logs/2021-03-17T14_44_00_151Z-debug.log
We would like to support npm v7, but I believe we still also need to support npm v6 which is the default version that ships with Node.js v12. So ideally we would identify code changes that allow us to support both npm v6 and npm v7.
Even with supported Node.js versions like Node.js v12, npm v7 is not currently supported:
We would like to support npm v7, but I believe we still also need to support npm v6 which is the default version that ships with Node.js v12. So ideally we would identify code changes that allow us to support both npm v6 and npm v7.
Tested with balena CLI v12.41.2.