From 0bf0bf819b04e0c96aabf1e959d4a592970e64ec Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Fri, 5 Apr 2024 10:56:39 +0300 Subject: [PATCH] fix(admin-ui): Resolve `node-gyp` error during installation with npm (#6952) Fix `node-gyp` error that occurs during installation when using NPM and 20+ versions of Node.js. The error results from the package `@stdlib/number-float64-base-normalize` which is a dependency of `@segment/analytics-next`. Installing v0.0.8 resolves the error. More details in PR #6485 ## Testing To test out the fix: 1. In a Medusa backend, remove the installation of `@stdlib/number-float64-base-normalize` (if available) and add instead the following override: ```json "overrides": { "@medusajs/admin": { "@medusajs/admin-ui": "2.1.14-snapshot-20240405070935" } } ``` 2. Remove node_modules + any previous package-lock.json 3. Change to node v20+ and use npm to install dependencies -> no error occurs during installation. --- .changeset/friendly-readers-begin.md | 5 +++++ packages/admin-ui/package.json | 1 + yarn.lock | 16 ++++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 .changeset/friendly-readers-begin.md diff --git a/.changeset/friendly-readers-begin.md b/.changeset/friendly-readers-begin.md new file mode 100644 index 0000000000..96f2c2e6b7 --- /dev/null +++ b/.changeset/friendly-readers-begin.md @@ -0,0 +1,5 @@ +--- +"@medusajs/admin-ui": patch +--- + +fix(admin-ui): Resolve `node-gyp` error during installation with npm diff --git a/packages/admin-ui/package.json b/packages/admin-ui/package.json index b3a5073f6f..036900a5a8 100644 --- a/packages/admin-ui/package.json +++ b/packages/admin-ui/package.json @@ -52,6 +52,7 @@ "@radix-ui/react-switch": "^1.0.1", "@radix-ui/react-tooltip": "^1.0.3", "@segment/analytics-next": "^1.51.1", + "@stdlib/number-float64-base-normalize": "0.0.8", "@svgr/webpack": "^8.0.1", "@swc/core": "^1.3.61", "@tailwindcss/forms": "^0.5.3", diff --git a/yarn.lock b/yarn.lock index 794f2f19d6..103dce21df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7834,6 +7834,7 @@ __metadata: "@radix-ui/react-switch": ^1.0.1 "@radix-ui/react-tooltip": ^1.0.3 "@segment/analytics-next": ^1.51.1 + "@stdlib/number-float64-base-normalize": 0.0.8 "@svgr/webpack": ^8.0.1 "@swc/core": ^1.3.61 "@tailwindcss/forms": ^0.5.3 @@ -14118,6 +14119,21 @@ __metadata: languageName: node linkType: hard +"@stdlib/number-float64-base-normalize@npm:0.0.8": + version: 0.0.8 + resolution: "@stdlib/number-float64-base-normalize@npm:0.0.8" + dependencies: + "@stdlib/constants-float64-smallest-normal": ^0.0.x + "@stdlib/math-base-assert-is-infinite": ^0.0.x + "@stdlib/math-base-assert-is-nan": ^0.0.x + "@stdlib/math-base-special-abs": ^0.0.x + "@stdlib/types": ^0.0.x + "@stdlib/utils-define-nonenumerable-read-only-property": ^0.0.x + checksum: 8b0f4d9d4cb7ca66636d22799ebb157a7b682374f1595f1c9124bf432d628a34984fd98ab9d73224b52e6d64584f4d33589adf4dbd50c839cc4a9920536bc7a6 + conditions: (os=aix | os=darwin | os=freebsd | os=linux | os=macos | os=openbsd | os=sunos | os=win32 | os=windows) + languageName: node + linkType: hard + "@stdlib/number-float64-base-normalize@npm:^0.0.x": version: 0.0.9 resolution: "@stdlib/number-float64-base-normalize@npm:0.0.9"