I have been trying to install three.js on my m1 macbook pro macos 12.5 using npm (node version 18.7.0, npm version 8.15.0) and it fails. The following is the npm log from the install:
0 verbose cli /opt/homebrew/Cellar/node/18.7.0/bin/node /opt/homebrew/bin/npm
1 info using npm@8.15.0
2 info using node@v18.7.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 0ms
5 timing config:load:file:/opt/homebrew/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 2ms
7 timing config:load:cli Completed in 0ms
8 timing config:load:env Completed in 0ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:/Users/paulsmith/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/opt/homebrew/etc/npmrc Completed in 1ms
13 timing config:load:global Completed in 1ms
14 timing config:load:validate Completed in 0ms
15 timing config:load:credentials Completed in 0ms
16 timing config:load:setEnvs Completed in 1ms
17 timing config:load Completed in 7ms
18 timing npm:load:configload Completed in 7ms
19 timing npm:load:mkdirpcache Completed in 0ms
20 timing npm:load:mkdirplogs Completed in 0ms
21 verbose title npm install three
22 verbose argv "install" "three"
23 timing npm:load:setTitle Completed in 2ms
24 timing config:load:flatten Completed in 1ms
25 timing npm:load:display Completed in 1ms
26 verbose logfile logs-max:10 dir:/Users/paulsmith/.npm/_logs
27 verbose logfile /Users/paulsmith/.npm/_logs/2022-08-07T22_40_34_309Z-debug-0.log
28 timing npm:load:logFile Completed in 3ms
29 timing npm:load:timers Completed in 0ms
30 timing npm:load:configScope Completed in 0ms
31 timing npm:load Completed in 15ms
32 timing arborist:ctor Completed in 0ms
33 silly logfile done cleaning log files
34 timing idealTree:init Completed in 16ms
35 timing idealTree:userRequests Completed in 1ms
36 silly idealTree buildDeps
37 silly fetch manifest three@*
38 verbose shrinkwrap failed to load node_modules/.package-lock.json out of date, updated: node_modules
39 silly placeDep ROOT three@ REPLACE for: want: *
40 timing idealTree:#root Completed in 70094ms
41 timing idealTree:node_modules/three Completed in 0ms
42 timing idealTree:node_modules/three.js Completed in 0ms
43 timing idealTree:buildDeps Completed in 70095ms
44 timing idealTree:fixDepFlags Completed in 1ms
45 timing idealTree Completed in 70116ms
46 timing command:install Completed in 70121ms
47 verbose type system
48 verbose stack FetchError: request to https://registry.npmjs.org/three failed, reason: connect EBADF 104.16.18.35:443
48 verbose stack at ClientRequest. (/opt/homebrew/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)
48 verbose stack at ClientRequest.emit (node:events:513:28)
48 verbose stack at TLSSocket.socketErrorListener (node:_http_client:481:9)
48 verbose stack at TLSSocket.emit (node:events:525:35)
48 verbose stack at emitErrorNT (node:internal/streams/destroy:151:8)
48 verbose stack at emitErrorCloseNT (node:internal/streams/destroy:116:3)
48 verbose stack at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
49 verbose cwd /Users/paulsmith/Developer/SonarioDevelopment/SonarioCurrentRelease/TestProject/webglClass/library/npm
50 verbose Darwin 21.6.0
51 verbose node v18.7.0
52 verbose npm v8.15.0
53 error code EBADF
54 error syscall connect
55 error errno EBADF
56 error request to https://registry.npmjs.org/three failed, reason: connect EBADF 104.16.18.35:443
57 verbose exit 1
58 timing npm Completed in 70194ms
59 verbose unfinished npm timer reify 1659912034361
60 verbose unfinished npm timer reify:loadTrees 1659912034362
61 verbose code 1
62 error A complete log of this run can be found in:
62 error /Users/paulsmith/.npm/_logs/2022-08-07T22_40_34_309Z-debug-0.log
58 timing npm Completed in 70194ms
59 verbose unfinished npm timer reify 1659912034361
60 verbose unfinished npm timer reify:loadTrees 1659912034362
61 verbose code 1
62 error A complete log of this run can be found in:
62 error /Users/paulsmith/.npm/_logs/2022-08-07T22_40_34_309Z-debug-0.log