@sapphire/type Issues

Hi there, I had been attempting to use the eval command provided in the full template (because I was too lazy to write one) and, upon attempting to install @sapphire/type I'm given the error below (please see the attached image) and I had initally thought it was an error with me not having node-gyp installed (I do, and have verified it, I've uninstalled the XCode Developer tools and reinstalled just to make sure it wasn't that as well), since I had searched and attempted to troubleshoot before making a thread, however, upon closer inspection, it would appear that it's attempting to fetch a release that isn't there. I do apologize if I've missed something important, if that's the case, I was unable to find it and I am once again, highly sorry. Thank you for taking the time to read this :D Additional Information NodeJS Version: v20.23.1 Package Manager: pnpm Hardware: M2 MacBook Air
No description
20 Replies
Favna
Favna8mo ago
That just means you then need xcode command line tools as it will fall back to building on you system as the logs show. This is therefore a false positive. If the build fails (omitted in your screenshot if so), that's a whole different problem. Also FYI you're using Node 21.7.1, not Node 20. The logs list the version. If you truly expected 20.23.1 then you likely have Node installed twice somewhere and you should fix that. Possibly through both Brew and Volta/nvm/etc.
Lavender
LavenderOP8mo ago
I had attempted to troubleshoot and see if the Homebrew version of NodeJS was causing issues, so I had uninstalled that and installed it directly from nodejs.org, hence the version mismatch 😄
Favna
Favna8mo ago
Well we offer quite a few prebuilts but only for stable LTS versions so never uneven numbers like 21 Possibly if you switch to node 20 it just downloads
Lavender
LavenderOP8mo ago
Here's the rest of the log, should've included it to begin with, my apologies
No description
No description
Favna
Favna8mo ago
Actually nvm there are no prebuilts for MacOS ARM yet. GitHub runners don't have MacOS arm runners yet. Oh that Update your python version Or wait no What's your package manager?
Lavender
LavenderOP8mo ago
pnpm
Favna
Favna8mo ago
Either way you need to force node-gyp to V10 or above
Spinel
Spinel8mo ago
npm npm doesn't have anything to update transient dependencies so you'll have to provide overrides. In your package.json:
{
"overrides": {
"package-name-here": "version"
}
}
{
"overrides": {
"package-name-here": "version"
}
}
Then run npm install. You can verify the change by checking your package-lock.json Yarn v1 Yarn v1 (deprecated, recommend updating to v4 (see /tag query:yarnv4 ) does not have a way to update transient dependencies so a similar strategy is required as npm: In your package.json:
{
"resolutions": {
"package-name-here": "version"
}
}
{
"resolutions": {
"package-name-here": "version"
}
}
Then run yarn install. You can verify the change by checking your yarn.lock Yarn v4 Yarn v4 can update transient dependencies so run the command:
yarn up -R package-name-here
yarn up -R package-name-here
pnpm pnpm can also update transient dependencies so run the command:
pnpm --recursive update package-name-here@version
pnpm --recursive update package-name-here@version
Favna
Favna8mo ago
So the bottom one and do @10.x Python 3.12 removed distutils and older node gyp versions still depend on it
Lavender
LavenderOP8mo ago
Unsure if I'm doing this right, but if I'm not mistaken, it would be pnpm --recursive update [email protected]?
Favna
Favna8mo ago
Yes
Spinel
Spinel8mo ago
node-gyp
Node.js native addon build tool ❯ Author: nodejs ❯ Maintainers: lukekarrys, rvagg, and nodejs-foundation ❯ Latest version: 10.1.0 ❯ License: MIT ❯ Date Created: <t:1328471270:d> ❯ Date Modified: <t:1711390006:d> Dependencies: env-paths, exponential-backoff, glob, graceful-fs, make-fetch-happen, nopt, proc-log, semver, tar, and which
Favna
Favna8mo ago
Look like the latest version is 10.1.0
Lavender
LavenderOP8mo ago
I do apologize once more, however it would appear the error still occurs (assuming I did it right)
Favna
Favna8mo ago
node-gyp says v9 in those logs. Can you try adding overrides to force it to 10.1.0 instead? https://pnpm.io/package_json#pnpmoverrides
package.json | pnpm
The manifest file of a package. It contains all the package's metadata,
Lavender
LavenderOP8mo ago
No dice still sadly
Favna
Favna8mo ago
Urgh I'll have to see how pnpm does stuff for me later Should be noted that I won't have time until at least tomorrow evening (CEST timezone). I'll have to test this specifically on my own ARM macbook (M1 chip) and I'm quite busy until tomorrow evening.
Favna
Favna7mo ago
I revisited this post just now @Lavender and I cannot reproduce the issue. What I did was 1. Generate a new bot with sapphire new, complete template 2. Selected yarn to ensure it would install initially 3. cd into the folder 4. remove - node_modules - .yarn folder - .yarnrc.yml file - yarn.lock file - the packageManager field in package.json - the @sapphire/type dependency (so essentially it's a clean slate project now) 5. Run pnpm i (so this doesnt install /type) 6. Run pnpm i @sapphire/type to re-add it And... it just works. Interestingly I also dont even see a node-gyp dependency in pnpm-lock.yaml Next I tried selecting pnpm during setup of the project with sapphire new and it once again appears to just work. No installation issues whatsoever. As seen in the screenshot, pnpm doesnt even log if it's getting the dependecy from the web (potentially 404ing) or if it's being built locally. I then tried first running pnpm store prune to ensure the cache locally was empty and once again tried installing @sapphire/type in a project that has no Node state at all, other than a package.json that doesn't mention @sapphire/type and it once again just worked. The second screenshot shows that.
$ pnpx envinfo --system --binaries --browsers --npmPackages "{@sapphire/*}"

System:
OS: macOS 14.5
CPU: (8) arm64 Apple M1
Memory: 65.17 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.13.1 - ~/.volta/tools/image/node/20.13.1/bin/node
Yarn: 4.1.1 - ~/.volta/tools/image/yarn/4.1.1/bin/yarn
npm: 10.5.2 - ~/.volta/tools/image/node/20.13.1/bin/npm
pnpm: 9.1.2 - ~/.volta/bin/pnpm
bun: 1.0.35 - /opt/homebrew/bin/bun
Browsers:
Safari: 17.5
$ pnpx envinfo --system --binaries --browsers --npmPackages "{@sapphire/*}"

System:
OS: macOS 14.5
CPU: (8) arm64 Apple M1
Memory: 65.17 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.13.1 - ~/.volta/tools/image/node/20.13.1/bin/node
Yarn: 4.1.1 - ~/.volta/tools/image/yarn/4.1.1/bin/yarn
npm: 10.5.2 - ~/.volta/tools/image/node/20.13.1/bin/npm
pnpm: 9.1.2 - ~/.volta/bin/pnpm
bun: 1.0.35 - /opt/homebrew/bin/bun
Browsers:
Safari: 17.5
No description
No description
Lavender
LavenderOP7mo ago
Thank you for that, upon closer inspection, it appears to be an issue with pnpm using an outdated version of node-gyp. Instead of pnpm I ended up using npm and it installed just fine (that was after I had followed the steps to get NodeJS to use the global install of node-gyp) so I'm going to just use npm for the time being until I can figure out a solution.
Favna
Favna7mo ago
weird then that I dont have that problem
Want results from more Discord servers?
Add your server