@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 Air20 Replies
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.
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 😄
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
Here's the rest of the log, should've included it to begin with, my apologies
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?
pnpm
Either way you need to force node-gyp to V10 or above
npm
npm doesn't have anything to update transient dependencies so you'll have to provide
overrides
.
In your package.json
:
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
:
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:
pnpm
pnpm can also update transient dependencies so run the command:
So the bottom one and do @10.x
Python 3.12 removed distutils and older node gyp versions still depend on it
Unsure if I'm doing this right, but if I'm not mistaken, it would be
pnpm --recursive update [email protected]
?Yes
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
Look like the latest version is 10.1.0
I do apologize once more, however it would appear the error still occurs (assuming I did it right)
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,
No dice still sadly
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.
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.
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.
weird then that I dont have that problem