Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Node.js V18 #32

Merged
merged 6 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
unsafe-perm=true
user=0
6 changes: 3 additions & 3 deletions app/engine/RowingStatistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ function createRowingStatistics (config) {
}

function getMetrics () {
const cyclePace = cycleLinearVelocity.clean() !== 0 && cycleLinearVelocity.raw() > 0 && sessionStatus === 'Rowing' ? (500.0 / cycleLinearVelocity.clean()) : Infinity
const cyclePace = cycleLinearVelocity.clean() !== 0 && sessionStatus === 'Rowing' ? (500.0 / cycleLinearVelocity.clean()) : Infinity
return {
sessiontype: intervalTargetDistance > 0 ? 'Distance' : (intervalTargetTime > 0 ? 'Time' : 'JustRow'),
sessionStatus,
Expand All @@ -391,8 +391,8 @@ function createRowingStatistics (config) {
cycleDuration: cycleDuration.clean() > minimumStrokeTime && cycleDuration.clean() < maximumStrokeTime && cycleLinearVelocity.raw() > 0 && sessionStatus === 'Rowing' ? cycleDuration.clean() : NaN, // seconds
cycleStrokeRate: cycleDuration.clean() > minimumStrokeTime && cycleLinearVelocity.raw() > 0 && sessionStatus === 'Rowing' ? (60.0 / cycleDuration.clean()) : 0, // strokeRate in SPM
cycleDistance: cycleDistance.raw() > 0 && cycleLinearVelocity.raw() > 0 && sessionStatus === 'Rowing' ? cycleDistance.clean() : 0, // meters
cycleLinearVelocity: cycleLinearVelocity.clean() > 0 && cycleLinearVelocity.raw() > 0 && sessionStatus === 'Rowing' ? cycleLinearVelocity.clean() : 0, // m/s
cyclePace: cycleLinearVelocity.raw() > 0 ? cyclePace : Infinity, // seconds/50 0m
cycleLinearVelocity: cycleLinearVelocity.clean() > 0 && sessionStatus === 'Rowing' ? cycleLinearVelocity.clean() : 0, // m/s
cyclePace: cycleLinearVelocity.clean() > 0 && sessionStatus === 'Rowing' ? cyclePace : Infinity, // seconds/500m
cyclePower: cyclePower.clean() > 0 && cycleLinearVelocity.raw() > 0 && sessionStatus === 'Rowing' ? cyclePower.clean() : 0, // watts
cycleProjectedEndTime: intervalTargetDistance > 0 ? distanceOverTime.projectY(intervalTargetDistance) : intervalTargetTime,
cycleProjectedEndLinearDistance: intervalTargetTime > 0 ? distanceOverTime.projectX(intervalTargetTime) : intervalTargetDistance,
Expand Down
2 changes: 1 addition & 1 deletion app/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ function logMetrics (metrics) {

/*
replayRowingSession(handleRotationImpulse, {
// filename: 'recordings/2021/04/rx800_2021-04-21_1845_Rowing_30Minutes_Damper8.csv', // 30 minutes, damper 10
filename: 'recordings/Concept2_RowErg_Session_2000meters.csv', // Example row from a Concept 2 RowErg, 2000 meters
realtime: true,
loop: false
})
Expand Down
1 change: 0 additions & 1 deletion install/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import rowerProfiles from './rowerProfiles.js'

export default {
/*
// example: change the default log level:
loglevel: {
default: 'debug'
Expand Down
7 changes: 5 additions & 2 deletions install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ then
sudo ln -sfn /opt/nodejs/bin/npm /usr/local/bin/npm
else
print "Installing Node.js..."
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
fi

Expand Down Expand Up @@ -178,7 +178,10 @@ sudo git reset --hard origin/v1beta_updates
echo "export PATH=\"\$PATH:$INSTALL_DIR/bin\"" >> ~/.bashrc

# otherwise node-gyp would fail while building the system dependencies
sudo npm config set user 0
# On newer nodejs versions (> Node 16) we solve this via the .npmrc file
if [[ $ARCHITECTURE == "armv6l" ]]; then
sudo npm config set user 0
fi

print
print "Downloading and compiling Runtime dependencies..."
Expand Down
Loading