nodejs / node-gyp

Node.js native addon build tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Install of local node packages fails for node-gyp with error "Cannot assign to read only property 'cflags' of object"

caewok opened this issue · comments

I am trying to install eslint. But attempting to install that or any other package throws an error about cflag that appears to be related to node-gyp. It seems like it is trying to use v7 of node-gyp, despite having installed what I thought was v10. The detailed output shows first the install of node-gyp and then the attempt to install eslint. This is on macos.

(In the past, I had eslint working, but something---system updates, presumably---borked it.)

Thanks for any assistance!

  • Node Version:
> node -v
v20.12.2

> npm -v
10.5.2
  • Platform:
> uname -a
Darwin Michaels-MBP 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000 arm64
  • Compiler:
> cc -v
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
  • Module:
Verbose output (from npm or node-gyp):
>  npm install -g node-gyp --verbose          
npm verb cli /Users/[USER]/.nvm/versions/node/v20.12.2/bin/node /Users/[USER]/.nvm/versions/node/v20.12.2/bin/npm
npm info using npm@10.5.2
npm info using node@v20.12.2
npm verb title npm install node-gyp
npm verb argv "install" "--global" "node-gyp" "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:/Users/[USER]/.npm/_logs/2024-04-22T20_42_18_285Z-
npm verb logfile /Users/[USER]/.npm/_logs/2024-04-22T20_42_18_285Z-debug-0.log
npm http fetch GET 200 https://registry.npmjs.org/node-gyp 238ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/exponential-backoff 61ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/which 67ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/env-paths 168ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/nopt 167ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/glob 169ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/make-fetch-happen 171ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/semver 173ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/graceful-fs 194ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/tar 196ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/proc-log 202ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/minimatch 53ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/jackspeak 57ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/foreground-child 61ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/cacache 61ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/path-scurry 65ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/minipass 69ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/is-lambda 74ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/http-cache-semantics 74ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@npmcli%2fagent 86ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/minipass 55ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/negotiator 53ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/minipass-fetch 64ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/minipass-pipeline 59ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/minipass-flush 63ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/promise-retry 56ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/ssri 54ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/abbrev 57ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/lru-cache 63ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/chownr 60ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/fs-minipass 54ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/yallist 53ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/minizlib 56ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/mkdirp 55ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/isexe 56ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/signal-exit 62ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/brace-expansion 67ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/cross-spawn 69ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@isaacs%2fcliui 125ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@pkgjs%2fparseargs 125ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/shebang-command 53ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/path-key 54ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/shebang-regex 56ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/string-width 53ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/strip-ansi 59ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/wrap-ansi 58ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/strip-ansi 65ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/wrap-ansi 66ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/string-width 74ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/emoji-regex 55ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/emoji-regex 63ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/eastasianwidth 64ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/ansi-styles 63ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/ansi-styles 63ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/ansi-regex 67ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/ansi-regex 67ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/is-fullwidth-code-point 78ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/p-map 53ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/http-proxy-agent 57ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/minipass-collect 60ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/minipass-sized 59ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/agent-base 62ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/https-proxy-agent 63ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/unique-filename 71ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/socks-proxy-agent 73ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@npmcli%2ffs 103ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/err-code 53ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/encoding 56ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/retry 55ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/debug 61ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/debug 63ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/socks 65ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/ms 46ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/unique-slug 50ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/aggregate-error 61ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/balanced-match 46ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/iconv-lite 59ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/safer-buffer 54ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/indent-string 54ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/clean-stack 66ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/ip-address 74ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/smart-buffer 76ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/jsbn 58ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/sprintf-js 58ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/imurmurhash 73ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/color-convert 61ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/color-name 68ms (cache revalidated)

added 101 packages in 2s

14 packages are looking for funding
  run `npm fund` for details
npm verb exit 0
npm info ok 
> npm install eslint --verbose
npm verb cli /Users/[USER]/.nvm/versions/node/v20.12.2/bin/node /Users/[USER]/.nvm/versions/node/v20.12.2/bin/npm
npm info using npm@10.5.2
npm info using node@v20.12.2
npm verb title npm install eslint
npm verb argv "install" "eslint" "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:/Users/[USER]/.npm/_logs/2024-04-22T20_32_58_809Z-
npm verb logfile /Users/[USER]/.npm/_logs/2024-04-22T20_32_58_809Z-debug-0.log
npm http fetch GET 200 https://registry.npmjs.org/eslint 231ms (cache revalidated)
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 368ms
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm http fetch GET 200 https://registry.npmjs.org/word-wrap 117ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/minimist 118ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/json5 119ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/semver 119ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/tar 120ms (cache hit)
npm WARN deprecated uuid@3.4.0: 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 request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm http fetch GET 200 https://registry.npmjs.org/tough-cookie 171ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/request 265ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/node-gyp 72ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/node-abi 12ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/eslint-plugin-node 4ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/tsconfig-paths 4ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/prebuild-install 17ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/rc 22ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/optionator 2ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/gl 2ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/gpu.js 2ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/gpu-mock.js 3ms (cache hit)
npm info run gl@4.9.2 install node_modules/gl prebuild-install || node-gyp rebuild
npm info run gl@4.9.2 install { code: 7, signal: null }
npm verb stack Error: command failed
npm verb stack     at ChildProcess.<anonymous> (/Users/[USER]/.nvm/versions/node/v20.12.2/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27)
npm verb stack     at ChildProcess.emit (node:events:518:28)
npm verb stack     at maybeClose (node:internal/child_process:1105:16)
npm verb stack     at Socket.<anonymous> (node:internal/child_process:457:11)
npm verb stack     at Socket.emit (node:events:518:28)
npm verb stack     at Pipe.<anonymous> (node:net:337:12)
npm verb pkgid gl@4.9.2
npm verb cwd /Users/[USER]/git/[GIT_REPOSITORY]
npm verb Darwin 23.4.0
npm verb node v20.12.2
npm verb npm  v10.5.2
npm ERR! code 7
npm ERR! path /Users/[USER]/node_modules/gl
npm ERR! command failed
npm ERR! command sh -c prebuild-install || node-gyp rebuild
npm ERR! prebuild-install info begin Prebuild-install version 5.3.6
npm ERR! prebuild-install info install installing standalone, skipping download.
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   '/Users/[USER]/.nvm/versions/node/v20.12.2/bin/node',
npm ERR! gyp verb cli   '/Users/[USER]/node_modules/.bin/node-gyp',
npm ERR! gyp verb cli   'rebuild'
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@20.12.2 | darwin | arm64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb find Python Python is not set from command line or npm configuration
npm ERR! gyp verb find Python Python is not set from environment variable PYTHON
npm ERR! gyp verb find Python checking if "python3" can be used
npm ERR! gyp verb find Python - executing "python3" to get executable path
npm ERR! gyp verb find Python - executable path is "/opt/homebrew/opt/python@3.12/bin/python3.12"
npm ERR! gyp verb find Python - executing "/opt/homebrew/opt/python@3.12/bin/python3.12" to get version
npm ERR! gyp verb find Python - version is "3.12.3"
npm ERR! gyp info find Python using Python version 3.12.3 found at "/opt/homebrew/opt/python@3.12/bin/python3.12"
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 20.12.2
npm ERR! gyp verb command install [ '20.12.2' ]
npm ERR! gyp verb install input version string "20.12.2"
npm ERR! gyp verb install installing version: 20.12.2
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 11
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 20.12.2
npm ERR! gyp verb build dir attempting to create "build" dir: /Users/[USER]/node_modules/gl/build
npm ERR! gyp verb build dir "build" dir needed to be created? /Users/[USER]/node_modules/gl/build
npm ERR! gyp verb build/config.gypi creating config file
npm ERR! gyp ERR! UNCAUGHT EXCEPTION 
npm ERR! gyp ERR! stack TypeError: Cannot assign to read only property 'cflags' of object '#<Object>'
npm ERR! gyp ERR! stack     at createConfigFile (/Users/[USER]/node_modules/node-gyp/lib/configure.js:117:21)
npm ERR! gyp ERR! stack     at /Users/[USER]/node_modules/node-gyp/lib/configure.js:84:9
npm ERR! gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:194:23)
npm ERR! gyp ERR! System Darwin 23.4.0
npm ERR! gyp ERR! command "/Users/[USER]/.nvm/versions/node/v20.12.2/bin/node" "/Users/[USER]/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Users/[USER]/node_modules/gl
npm ERR! gyp ERR! node -v v20.12.2
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! Node-gyp failed to build your package.
npm ERR! gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.
npm verb exit 7
npm verb unfinished npm timer reify 1713817978942
npm verb unfinished npm timer reify:build 1713817980188
npm verb unfinished npm timer build 1713817980188
npm verb unfinished npm timer build:deps 1713817980189
npm verb unfinished npm timer build:run:install 1713817980193
npm verb unfinished npm timer build:run:install:node_modules/gl 1713817980193
npm verb code 7
> npm install eslint@latest --verbose
npm verb cli /Users/[User]/.nvm/versions/node/v20.12.2/bin/node /Users/[User]/.nvm/versions/node/v20.12.2/bin/npm
npm info using npm@10.5.2
npm info using node@v20.12.2
npm verb title npm install eslint@latest
npm verb argv "install" "eslint@latest" "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:/Users/[User]/.npm/_logs/2024-04-22T22_18_19_603Z-
npm verb logfile /Users/[User]/.npm/_logs/2024-04-22T22_18_19_603Z-debug-0.log
npm http fetch GET 200 https://registry.npmjs.org/eslint 374ms (cache revalidated)
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: undefined@undefined
npm WARN Found: eslint@7.32.0
npm WARN node_modules/eslint
npm WARN   peer eslint@"^7.12.1" from eslint-config-standard@16.0.3
npm WARN   node_modules/eslint-config-standard
npm WARN     dev eslint-config-standard@"^16.0.3" from the root project
npm WARN   5 more (eslint-plugin-es, eslint-plugin-import, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer eslint@"^7.12.1" from eslint-config-standard@16.0.3
npm WARN node_modules/eslint-config-standard
npm WARN   dev eslint-config-standard@"^16.0.3" from the root project
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: undefined@undefined
npm WARN Found: eslint@7.32.0
npm WARN node_modules/eslint
npm WARN   peer eslint@"^7.12.1" from eslint-config-standard@16.0.3
npm WARN   node_modules/eslint-config-standard
npm WARN     dev eslint-config-standard@"^16.0.3" from the root project
npm WARN   5 more (eslint-plugin-es, eslint-plugin-import, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer eslint@"^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" from eslint-plugin-import@2.25.4
npm WARN node_modules/eslint-plugin-import
npm WARN   peer eslint-plugin-import@"^2.22.1" from eslint-config-standard@16.0.3
npm WARN   node_modules/eslint-config-standard
npm WARN   1 more (the root project)
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: undefined@undefined
npm WARN Found: eslint@7.32.0
npm WARN node_modules/eslint
npm WARN   peer eslint@"^7.12.1" from eslint-config-standard@16.0.3
npm WARN   node_modules/eslint-config-standard
npm WARN     dev eslint-config-standard@"^16.0.3" from the root project
npm WARN   5 more (eslint-plugin-es, eslint-plugin-import, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer eslint@"^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" from eslint-plugin-import@2.25.4
npm WARN node_modules/eslint-plugin-import
npm WARN   peer eslint-plugin-import@"^2.22.1" from eslint-config-standard@16.0.3
npm WARN   node_modules/eslint-config-standard
npm WARN   1 more (the root project)
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: undefined@undefined
npm WARN Found: eslint@7.32.0
npm WARN node_modules/eslint
npm WARN   peer eslint@"^7.12.1" from eslint-config-standard@16.0.3
npm WARN   node_modules/eslint-config-standard
npm WARN     dev eslint-config-standard@"^16.0.3" from the root project
npm WARN   5 more (eslint-plugin-es, eslint-plugin-import, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer eslint@"^7.0.0" from eslint-plugin-promise@5.2.0
npm WARN node_modules/eslint-plugin-promise
npm WARN   peer eslint-plugin-promise@"^4.2.1 || ^5.0.0" from eslint-config-standard@16.0.3
npm WARN   node_modules/eslint-config-standard
npm WARN   1 more (the root project)
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: undefined@undefined
npm WARN Found: eslint@7.32.0
npm WARN node_modules/eslint
npm WARN   peer eslint@"^7.12.1" from eslint-config-standard@16.0.3
npm WARN   node_modules/eslint-config-standard
npm WARN     dev eslint-config-standard@"^16.0.3" from the root project
npm WARN   5 more (eslint-plugin-es, eslint-plugin-import, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer eslint@"^7.0.0" from eslint-plugin-promise@5.2.0
npm WARN node_modules/eslint-plugin-promise
npm WARN   peer eslint-plugin-promise@"^4.2.1 || ^5.0.0" from eslint-config-standard@16.0.3
npm WARN   node_modules/eslint-config-standard
npm WARN   1 more (the root project)
npm http fetch GET 200 https://registry.npmjs.org/@eslint%2feslintrc 89ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/debug 157ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/eslint-scope 75ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@eslint-community%2feslint-utils 177ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@humanwhocodes%2fmodule-importer 187ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@nodelib%2ffs.walk 192ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@humanwhocodes%2fconfig-array 194ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@eslint%2fjs 201ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@humanwhocodes%2fretry 201ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@eslint-community%2fregexpp 203ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/esquery 52ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/eslint-visitor-keys 70ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/espree 67ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/file-entry-cache 60ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/is-path-inside 52ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/find-up 62ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/ignore 55ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/glob-parent 65ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/levn 57ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/optionator 50ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/minimatch 56ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/fastq 52ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/estraverse 52ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/import-fresh 61ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/globals 63ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/strip-json-comments 64ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/esrecurse 63ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/js-yaml 69ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@nodelib%2ffs.scandir 76ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@humanwhocodes%2fobject-schema 93ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/acorn-jsx 57ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/acorn 60ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/prelude-ls 58ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/locate-path 63ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/flat-cache 66ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/type-check 59ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/path-exists 68ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/deep-is 51ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/type-check 47ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/fast-levenshtein 62ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@aashutoshrathi%2fword-wrap 75ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/resolve-from 163ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/parent-module 164ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/argparse 165ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/reusify 57ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/run-parallel 57ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@nodelib%2ffs.stat 81ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/queue-microtask 59ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/keyv 51ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/flatted 66ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/json-buffer 58ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/callsites 47ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/p-locate 56ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/p-limit 55ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/yocto-queue 56ms (cache revalidated)
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 364ms
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: 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 request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm http fetch GET 200 https://registry.npmjs.org/semver 164ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/json5 166ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/request 170ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/minimist 171ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/tough-cookie 174ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/tar 179ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/node-gyp 59ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/node-abi 60ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/eslint-plugin-node 50ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/tsconfig-paths 48ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/rc 50ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/prebuild-install 50ms (cache revalidated)
npm info run gl@4.9.2 install node_modules/gl prebuild-install || node-gyp rebuild
npm http fetch GET 200 https://registry.npmjs.org/gl 168ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/gpu.js 182ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/gpu-mock.js 211ms (cache revalidated)
npm info run gl@4.9.2 install { code: 7, signal: null }
npm verb stack Error: command failed
npm verb stack     at ChildProcess.<anonymous> (/Users/[User]/.nvm/versions/node/v20.12.2/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27)
npm verb stack     at ChildProcess.emit (node:events:518:28)
npm verb stack     at maybeClose (node:internal/child_process:1105:16)
npm verb stack     at Socket.<anonymous> (node:internal/child_process:457:11)
npm verb stack     at Socket.emit (node:events:518:28)
npm verb stack     at Pipe.<anonymous> (node:net:337:12)
npm verb pkgid gl@4.9.2
npm verb cwd /Users/[User]/git/[GIT REPOSITORY]
npm verb Darwin 23.4.0
npm verb node v20.12.2
npm verb npm  v10.5.2
npm ERR! code 7
npm ERR! path /Users/[User]/node_modules/gl
npm ERR! command failed
npm ERR! command sh -c prebuild-install || node-gyp rebuild
npm ERR! prebuild-install info begin Prebuild-install version 5.3.6
npm ERR! prebuild-install info install installing standalone, skipping download.
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   '/Users/[User]/.nvm/versions/node/v20.12.2/bin/node',
npm ERR! gyp verb cli   '/Users/[User]/node_modules/.bin/node-gyp',
npm ERR! gyp verb cli   'rebuild'
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@20.12.2 | darwin | arm64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb find Python Python is not set from command line or npm configuration
npm ERR! gyp verb find Python Python is not set from environment variable PYTHON
npm ERR! gyp verb find Python checking if "python3" can be used
npm ERR! gyp verb find Python - executing "python3" to get executable path
npm ERR! gyp verb find Python - executable path is "/opt/homebrew/opt/python@3.12/bin/python3.12"
npm ERR! gyp verb find Python - executing "/opt/homebrew/opt/python@3.12/bin/python3.12" to get version
npm ERR! gyp verb find Python - version is "3.12.3"
npm ERR! gyp info find Python using Python version 3.12.3 found at "/opt/homebrew/opt/python@3.12/bin/python3.12"
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 20.12.2
npm ERR! gyp verb command install [ '20.12.2' ]
npm ERR! gyp verb install input version string "20.12.2"
npm ERR! gyp verb install installing version: 20.12.2
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 11
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 20.12.2
npm ERR! gyp verb build dir attempting to create "build" dir: /Users/[User]/node_modules/gl/build
npm ERR! gyp verb build dir "build" dir needed to be created? /Users/[User]/node_modules/gl/build
npm ERR! gyp verb build/config.gypi creating config file
npm ERR! gyp ERR! UNCAUGHT EXCEPTION 
npm ERR! gyp ERR! stack TypeError: Cannot assign to read only property 'cflags' of object '#<Object>'
npm ERR! gyp ERR! stack     at createConfigFile (/Users/[User]/node_modules/node-gyp/lib/configure.js:117:21)
npm ERR! gyp ERR! stack     at /Users/[User]/node_modules/node-gyp/lib/configure.js:84:9
npm ERR! gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:194:23)
npm ERR! gyp ERR! System Darwin 23.4.0
npm ERR! gyp ERR! command "/Users/[User]/.nvm/versions/node/v20.12.2/bin/node" "/Users/[User]/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Users/[User]/node_modules/gl
npm ERR! gyp ERR! node -v v20.12.2
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! Node-gyp failed to build your package.
npm ERR! gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.
npm verb exit 7
npm verb unfinished npm timer reify 1713824299826
npm verb unfinished npm timer reify:build 1713824302321
npm verb unfinished npm timer build 1713824302321
npm verb unfinished npm timer build:deps 1713824302321
npm verb unfinished npm timer build:run:install 1713824302326
npm verb unfinished npm timer build:run:install:node_modules/gl 1713824302326
npm verb code 7

I had tried these instructions previously: https://github.com/nodejs/node-gyp/blob/main/docs/Updating-npm-bundled-node-gyp.md
Unclear if they are meant to work with npm v10, as they are only tested with v8. In any event, this command fails:

> npm explore npm/node_modules/@npmcli/run-script -g -- npm_config_global=false npm install node-gyp@latest
npm ERR! explore It doesn't look like npm/node_modules/@npmcli/run-script is installed.
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /Users/[USER]/.npm-packages/lib/node_modules/npm/node_modules/@npmcli/run-script/package.json
npm ERR! errno -2
npm ERR! enoent Could not read package.json: Error: ENOENT: no such file or directory, open '/Users/[USER]/.npm-packages/lib/node_modules/npm/node_modules/@npmcli/run-script/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 
npm install @npmcli/run-script@latest

npm explore npm/node_modules/@npmcli/run-script -g -- npm_config_global=false npm install node-gyp@latest

npm install eslint@latest eslint-config-standard@latest --verbose

Same error message as:

The first command fails to install, so the second fails. Here is the first and third command outputs.

> npm install @npmcli/run-script@latest
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: 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 request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 7
npm ERR! path /Users/[USER]/node_modules/gl
npm ERR! command failed
npm ERR! command sh -c prebuild-install || node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@20.12.2 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.12.3 found at "/opt/homebrew/opt/python@3.12/bin/python3.12"
npm ERR! gyp ERR! UNCAUGHT EXCEPTION 
npm ERR! gyp ERR! stack TypeError: Cannot assign to read only property 'cflags' of object '#<Object>'
npm ERR! gyp ERR! stack     at createConfigFile (/Users/[USER]/node_modules/node-gyp/lib/configure.js:117:21)
npm ERR! gyp ERR! stack     at /Users/[USER]/node_modules/node-gyp/lib/configure.js:84:9
npm ERR! gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:194:23)
npm ERR! gyp ERR! System Darwin 23.4.0
npm ERR! gyp ERR! command "/Users/[USER]/.nvm/versions/node/v20.12.2/bin/node" "/Users/[USER]/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Users/[USER]/node_modules/gl
npm ERR! gyp ERR! node -v v20.12.2
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! Node-gyp failed to build your package.
npm ERR! gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.

Here is the third command:

> npm install eslint@latest eslint-config-standard@latest --verbose
npm verb cli /Users/[USER]/.nvm/versions/node/v20.12.2/bin/node /Users/[USER]/.nvm/versions/node/v20.12.2/bin/npm
npm info using npm@10.5.2
npm info using node@v20.12.2
npm verb title npm install eslint@latest eslint-config-standard@latest
npm verb argv "install" "eslint@latest" "eslint-config-standard@latest" "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:/Users/[USER]/.npm/_logs/2024-04-23T23_37_22_010Z-
npm verb logfile /Users/[USER]/.npm/_logs/2024-04-23T23_37_22_010Z-debug-0.log
npm http fetch GET 200 https://registry.npmjs.org/eslint-config-standard 192ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/eslint 195ms (cache revalidated)
npm verb stack Error: unable to resolve dependency tree
npm verb stack     at #failPeerConflict (/Users/[USER]/.nvm/versions/node/v20.12.2/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1387:25)
npm verb stack     at #loadPeerSet (/Users/[USER]/.nvm/versions/node/v20.12.2/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1353:33)
npm verb stack     at async #buildDepStep (/Users/[USER]/.nvm/versions/node/v20.12.2/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:924:11)
npm verb stack     at async Arborist.buildIdealTree (/Users/[USER]/.nvm/versions/node/v20.12.2/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:203:7)
npm verb stack     at async Promise.all (index 1)
npm verb stack     at async Arborist.reify (/Users/[USER]/.nvm/versions/node/v20.12.2/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:154:5)
npm verb stack     at async Install.exec (/Users/[USER]/.nvm/versions/node/v20.12.2/lib/node_modules/npm/lib/commands/install.js:153:5)
npm verb stack     at async module.exports (/Users/[USER]/.nvm/versions/node/v20.12.2/lib/node_modules/npm/lib/cli-entry.js:61:5)
npm verb cwd /Users/[USER]/git/[GIT_REPOSITORY]
npm verb Darwin 23.4.0
npm verb node v20.12.2
npm verb npm  v10.5.2
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: undefined@undefined
npm ERR! Found: eslint@9.1.1
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"9.1.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^8.0.1" from eslint-config-standard@17.1.0
npm ERR! node_modules/eslint-config-standard
npm ERR!   dev eslint-config-standard@"17.1.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /Users/[USER]/.npm/_logs/2024-04-23T23_37_22_010Z-eresolve-report.txt
npm verb exit 1
npm verb unfinished npm timer reify 1713915442242
npm verb unfinished npm timer reify:loadTrees 1713915442243
npm verb unfinished npm timer idealTree:buildDeps 1713915442493
npm verb unfinished npm timer idealTree:#root 1713915442493
npm verb code 1

Does the command brew --version return something like this?

Homebrew 4.2.19-38-g966454c
Homebrew/homebrew-cask (git revision c9b4b8f6d3; last commit 2024-04-23)

The log in the first message above says:

npm info run gl@4.9.2 install node_modules/gl prebuild-install || node-gyp rebuild
npm info run gl@4.9.2 install { code: 7, signal: null }
npm verb stack Error: command failed
npm verb stack     at ChildProcess.<anonymous> (/Users/[USER]/.nvm/versions/node/v20.12.2/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27)
npm verb stack     at ChildProcess.emit (node:events:518:28)
npm verb stack     at maybeClose (node:internal/child_process:1105:16)
npm verb stack     at Socket.<anonymous> (node:internal/child_process:457:11)
npm verb stack     at Socket.emit (node:events:518:28)
npm verb stack     at Pipe.<anonymous> (node:net:337:12)
npm verb pkgid gl@4.9.2

https://www.npmjs.com/package/gl is currently at gl@8.0.2 -- Can you please upgrade to that and then restart?

> brew --version 
Homebrew 4.2.19

I ran npm update -g gl, which appeared to work with no errors reported. Installing locally using npm update gl fails like everything else that I attempt to install or update locally:

> npm install gl
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: 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 request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 7
npm ERR! path /Users/[USER]/node_modules/gpu.js/node_modules/gl
npm ERR! command failed
npm ERR! command sh -c prebuild-install || node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@20.12.2 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.12.3 found at "/opt/homebrew/opt/python@3.12/bin/python3.12"
npm ERR! gyp ERR! UNCAUGHT EXCEPTION 
npm ERR! gyp ERR! stack TypeError: Cannot assign to read only property 'cflags' of object '#<Object>'
npm ERR! gyp ERR! stack     at createConfigFile (/Users/[USER]/node_modules/gpu.js/node_modules/node-gyp/lib/configure.js:117:21)
npm ERR! gyp ERR! stack     at /Users/[USER]/node_modules/gpu.js/node_modules/node-gyp/lib/configure.js:84:9
npm ERR! gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:194:23)
npm ERR! gyp ERR! System Darwin 23.4.0
npm ERR! gyp ERR! command "/Users/[USER]/.nvm/versions/node/v20.12.2/bin/node" "/Users/[USER]/node_modules/gpu.js/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Users/[USER]/node_modules/gpu.js/node_modules/gl
npm ERR! gyp ERR! node -v v20.12.2
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! Node-gyp failed to build your package.
npm ERR! gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.

npm ERR! A complete log of this run can be found in: /Users/[USER]/.npm/_logs/2024-04-26T14_06_44_224Z-debug-0.log
> npm update gl
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: 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 request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 7
npm ERR! path /Users/[USER]/node_modules/gl
npm ERR! command failed
npm ERR! command sh -c prebuild-install || node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@20.12.2 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.12.3 found at "/opt/homebrew/opt/python@3.12/bin/python3.12"
npm ERR! gyp ERR! UNCAUGHT EXCEPTION 
npm ERR! gyp ERR! stack TypeError: Cannot assign to read only property 'cflags' of object '#<Object>'
npm ERR! gyp ERR! stack     at createConfigFile (/Users/[USER]/node_modules/node-gyp/lib/configure.js:117:21)
npm ERR! gyp ERR! stack     at /Users/[USER]/node_modules/node-gyp/lib/configure.js:84:9
npm ERR! gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:194:23)
npm ERR! gyp ERR! System Darwin 23.4.0
npm ERR! gyp ERR! command "/Users/[USER]/.nvm/versions/node/v20.12.2/bin/node" "/Users/[USER]/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Users/[USER]/node_modules/gl
npm ERR! gyp ERR! node -v v20.12.2
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! Node-gyp failed to build your package.
npm ERR! gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.

npm ERR! A complete log of this run can be found in: /Users/[USER]/.npm/_logs/2024-04-26T14_10_40_705Z-debug-0.log

npm install @npmcli/run-script@latest fails with the same error I reported above after attempting to install

Do you have a package.json that has a node-gyp line? If so, please edit that line to use v10.1.0.

If that does not work, try npm update gl without the -g

brew info node
brew info npm

Okay, I think I figured it out, with the help of your last comment. There was no package.json in the git respository folder or in my main git folder, but when I looked at my home directory, I found a package-lock.json. Removing that fixed the issue, and now I can update gl and install eslint locally as per the original comment.

Thanks so much for walking through this with me!