Skip to content
Open
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
14 changes: 14 additions & 0 deletions .github/actions/install-npm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Install NPM
description: >
Installs the NPM version required by the `engines.npm` directive in
package.json, which is required for the project to build correctly.

runs:
using: composite
steps:
- name: Install NPM
shell: bash
run: |
npmVersion="$(node -p 'require(`${process.env.GITHUB_WORKSPACE}/package.json`).engines.npm')"
echo "Installing npm@${npmVersion}"
npm install -g "npm@${npmVersion}"
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: 16
- name: Install NPM version specified in package.json
uses: ./.github/actions/install-npm
- name: Install Dependencies
run: npm install
- name: Run Build
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: 16
- name: Install NPM version specified in package.json
uses: ./.github/actions/install-npm
- name: Install Dependencies
run: npm install
- name: Run Tests
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,9 @@ Messages that do not conform to the schemas are still processed and stored. Howe
- A successful AGPS response does not have an entry in the `deviceToCloud` directory because it returns a raw binary response (not JSON). In event of an error, AGPS will return JSON, which is documented.
- ts should be used instead of time. The time property is included to be backwards compatible with certain versions of asset tracker version 2 firmware. Future versions will use the ts property instead.
- The Location Service `deviceToCloud` endpoints (AGPS, PGPS, CELL_POS, SCELL, and WIFI) will return a standardized JSON response in event of an error, all include an `err` property with an error code, which are documented in the [REST API error code docs](https://api.nrfcloud.com/v1#section/Error-Codes).
- All GNSS `deviceToCloud` examples also work with the `appId = GPS`. Although the `GPS` appId is deprecated.
- All GNSS `deviceToCloud` examples also work with the `appId = GPS`. Although the `GPS` appId is deprecated.

## Node & NPM

This project requires Node.js `>=16.20.0` and npm `>=12.0.2 <13` (enforced via
`check-node-version` from the `prepare` script).
112 changes: 111 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"tslint": "tslint --project ./tsconfig.json",
"prettier:fix": "prettier \"./__tests__/**/*.ts\" --write",
"prettier:lint": "prettier --list-different \"./__tests__/**/*.ts\"",
"build": "rollup -c rollup.config.js"
"build": "rollup -c rollup.config.js",
"prepare": "check-node-version --package"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -45,6 +46,7 @@
"@types/glob": "^7.1.3",
"@types/jest": "^27.0.2",
"@types/node": "^16.0.0",
"check-node-version": "4.2.1",
"glob": "^7.1.7",
"husky": "^7.0.0",
"jest": "^27.0.6",
Expand Down Expand Up @@ -89,7 +91,7 @@
}
},
"engines": {
"npm": ">=8.19.4",
"npm": ">=12.0.2 <13",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node sixteen incompatible with npm twelve

High Severity

The project still requires Node >=16.20.0 and CI uses Node 16, while npm is pinned to >=12.0.2 &lt;13. npm 12 only supports Node ^22.22.2, ^24.15.0, or >=26.0.0, so the composite install-npm step and local installs on Node 16 can fail when upgrading npm, especially with engine-strict=true in .npmrc.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d68bee0. Configure here.

"yarn": "use npm",
"node": ">=16.20.0"
}
Expand Down
Loading