node-nightly icon indicating copy to clipboard operation
node-nightly copied to clipboard

TypeError: Cannot read properties of undefined (reading 'version')

Open root4loot opened this issue 2 years ago • 5 comments

$ npm install --global node-nightly
$ node-nightly
Checking for update...
TypeError: Cannot read properties of undefined (reading 'version')
    at /usr/local/lib/node_modules/node-nightly/node_modules/node-nightly-version/index.js:17:70
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
$ cat /usr/local/lib/node_modules/node-nightly/node_modules/node-nightly-version/index.js
'use strict';
const fetch = require('isomorphic-fetch');
const nightlyVersions = require('node-nightly-versions');
const osArch = `${process.platform}-${process.arch}`;
const osVerMap = {
  'win32-x64':'win-x64-msi',
  'win32-x86':'win-x86-msi',
  'darwin-x64':'osx-x64-pkg',//darwin is os name for osx
  'darwin-x86':'osx-x86-tar',
  'linux-x64':'linux-x64',
  'linux-x86':'linux-x86',
  'sunos-x64':'sunos-x64',
  'sunos-x86':'sunos-x86'
}
$ npm -v
8.5.5

$ uname -a
Darwin MBP 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:46:32 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T6000 arm64

root4loot avatar May 22 '22 23:05 root4loot

The same problem, don't support mac os m1(darwin-arm64), any solution?

MR-BH avatar Jul 08 '22 03:07 MR-BH

The same problem in mac os m2, any solution?

dogcat-ux avatar Jan 14 '23 02:01 dogcat-ux

Same issue on m1-max

ben-gryps avatar Jan 26 '23 17:01 ben-gryps

Same issue on m1-pro, any solution?

yuanyuanbyte avatar Jan 30 '23 11:01 yuanyuanbyte

I tried downloading osx-x64-pkg and it seems to be working. Just edited the node-nightly-version/index.js file as below:

module.exports = () => nightlyVersions()
  .then(versions => versions['osx-x64-pkg'].version);

beahuszar avatar Feb 22 '23 18:02 beahuszar