You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated work laptop (2021 M1 Macbook) to MacOs Sonoma 14.3.1
The Bug
When running the setup for UI Development (link), the npm run serve command fails with the following error:
/Users/{user}/Documents/OpenPATH_Repos/e-mission-phone/node_modules/macos-release/index.js:28
const [name, version] = nameMap.get(release);
^
TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
at macosRelease (/Users/{user}/Documents/OpenPATH_Repos/e-mission-phone/node_modules/macos-release/index.js:28:26)
at osName (/Users/{user}/Documents/OpenPATH_Repos/e-mission-phone/node_modules/phonegap/node_modules/insight/node_modules/os-name/index.js:21:18)
at new Insight (/Users/{user}/Documents/OpenPATH_Repos/e-mission-phone/node_modules/phonegap/node_modules/insight/lib/index.js:37:13)
at Object.<anonymous> (/Users/{user}/Documents/OpenPATH_Repos/e-mission-phone/node_modules/phonegap/node_modules/cordova/src/telemetry.js:26:15)
at Module._compile (node:internal/modules/cjs/loader:1246:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1300:10)
at Module.load (node:internal/modules/cjs/loader:1103:32)
at Module._load (node:internal/modules/cjs/loader:942:12)
at Module.require (node:internal/modules/cjs/loader:1127:19)
at require (node:internal/modules/helpers:112:18)
Node.js v19.5.0
phonegap --verbose serve exited with code 1
--> Sending SIGTERM to other processes..
webpack --config webpack.dev.js --watch exited with code SIGTERM
As can be seen in this error message, the issue seems to be that macOs Sonoma is missing from node_modules/macos-release/index.js. The file contains the following versions, notably lacking Sonoma...
Initially, I tried manually adding [23, ['Sonoma', '14']] to this file, with no success. This, of course, wouldn't't have been a long term solution (since this isn't tracked by our git). I believe there is different issue with our npm packages.
From what I've read in this stack overflow thread, the issue should be fixed then the corresponding node module is updated. Clicking through onto this thread, it seems that this module is dependant on cordova's version. When checking our package.serve.json, we have the following cordova-related dependancies...
Updating cordova to the latest version (12.0.0) does not fix the build error. This seems to suggest that the issue may be with ionic, or another related dependency. When running npm ls macos-release, we receive the following output:
As can be seen here, this macos-release is a few versions behind the plugin's current 3.2.0 link.
My thought, then, is to begin updating these plugins, starting with the lowest version, until we find one that will (i) not break our codebase going too far forward, and (2) update the macos-release version to an acceptable value.
I'm currently being pulled in a few different directions, and won't be able to address this immediately -- the bluetooth integradtion (link) needs to be wrapped up first. My desktop PC is struggling, but I should be able to continue with Android Development while the macos serve is broken.
That being me to my final thoughts -- if anyone has experience with these version issues, please feel free to add your two cents! Any pointers or advice would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
Finally found the solution! As Jack and Shankari suggested, the issue was with node_modules/macos-release/index.jsandsetup/autoreload/macos-index.js. The solution was to:
Edit setup/autoreload/macos-index.js, adding my current MacOS version as follows:
'use strict';constos=require('os');constnameMap=newMap([[23,['Sonoma','14.3.1']],// <- Version added[22,['Ventura','13']],[21,['Monterey','12']],// More versions below]);// more code below
After adding this line, run bash setup/setup_serve.sh, and source setup/activate_serve.sh.
Go into node_modules/macos-release/index.js, and add the missing MacOS version, as above.
With this, you should be able to either run npm start serve, or continue to building to hardware!
Background
e-mission-phone
The Bug
npm run serve
command fails with the following error:node_modules/macos-release/index.js
. The file contains the following versions, notably lacking Sonoma...Potential Solutions
Initially, I tried manually adding [23, ['Sonoma', '14']] to this file, with no success. This, of course, wouldn't't have been a long term solution (since this isn't tracked by our git). I believe there is different issue with our npm packages.
From what I've read in this stack overflow thread, the issue should be fixed then the corresponding node module is updated. Clicking through onto this thread, it seems that this module is dependant on
cordova
's version. When checking ourpackage.serve.json
, we have the following cordova-related dependancies...Updating cordova to the latest version (12.0.0) does not fix the build error. This seems to suggest that the issue may be with ionic, or another related dependency. When running
npm ls macos-release
, we receive the following output:As can be seen here, this macos-release is a few versions behind the plugin's current 3.2.0 link.
My thought, then, is to begin updating these plugins, starting with the lowest version, until we find one that will (i) not break our codebase going too far forward, and (2) update the
macos-release
version to an acceptable value.I'm currently being pulled in a few different directions, and won't be able to address this immediately -- the bluetooth integradtion (link) needs to be wrapped up first. My desktop PC is struggling, but I should be able to continue with Android Development while the macos
serve
is broken.That being me to my final thoughts -- if anyone has experience with these version issues, please feel free to add your two cents! Any pointers or advice would be greatly appreciated.
The text was updated successfully, but these errors were encountered: