-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
node-gyp rebuild fails in macOS Catalina (10.15) - No rule to make target node_modules/node-gyp/addon.gypi
, needed by `Makefile'.
#1779
Comments
Hello, so I updated my global installation of node-gyp and it is now failing with a very similar error when it goes to install integer@2.1.0, prior to reaching electron-builder... Verbose output (from npm or node-gyp):
|
Same issue occurs if node-gyp is forced to 5.0.0 in the package by doing |
node_modules/node-gyp/addon.gypi
, needed by `Makefile'.node_modules/node-gyp/addon.gypi
, needed by `Makefile'.
I'm running Mac OS Catalina and encountered this issue. I was installing node-memwatch for my node application. I've tried reinstalling using installer from the official website & brew install node The error still popped up. My workaround was installing node using nvm instead. I still do not have an idea what actually causes the issue though. |
same problem,seems the Catalina problem,andone have idea to solve it? |
sorry to do this but I'm going to close this and suggest you take this up with the authors of electron-builder. It looks to me like it's a problem with invocation. I also don't think we're going to be in a position to provide any support for Catalina until it's actually released, we hardly have the people + bandwidth to deal with supported operating systems. Sorry. |
@rvagg This isn't an issue with electron builder. Simply running |
I want to restate that support for Catalina is a low priority until it's in (or closer to) GA. But we can certainly collect more data on it. I'm certainly not going to jump onto the Catalina train until GA so it's going to be up to you early adopters that are willing to deal with breakage like this and yak shave your way to fixes. @Boxonical can you paste some output for your failed node-memwatch? Is it the same The fact that it works from nvm is interesting because you're getting an entirely different pathing structure to the global / npm node_modules directory. Given Apple's propensity to screw with /usr/local I'm wondering if they've done something else funky with that that's messing up relative pathing into there. So, for anyone that wants to help solve this, try this: When you get an error output that starts with something like this:
and then yields a failure like this:
|
Sorry I'm unable to recreate the issue ever since I use nvm to workaround. I've tried:
Prior to workaround I did encountered the same error I'm more convinced this is a node pathing issue instead of package (integer / node-memwatch) issue |
Following up to @rvagg I do have the same issue and relative to the |
I had the same issue and I think it is actually a problem with Catalina: cd /Users
ls ..
Device Users While the actual contents of the root directory is: ls /
Applications System bin etc mnt private tmp
Library Users cores home net sbin usr
Network Volumes dev installer.failurerequests opt sw var |
Might have something to do with / root dir becoming Read-only...
Looks like /Users is either a symlink or FS-level abstraction. I don't have my laptop rn but might be useful to see if |
Realpath doesn't give any useful clues realpath /Users
/Users However i have found a workaround that solves the problem of node-gyp, by setting the config directories of npm to a different directory that doesn't have the problem, like /opt: sudo mkdir /opt/node
sudo chown {user}: /opt/node
npm config set devdir /opt/node/npm
npm config set prefix /opt/node/npm-global
export PATH=~/opt/node/npm-global/bin:$PATH |
Hello, I am being affected by this on macOS Catalina 10.15 GA. Reading the comments makes me suspect, like others, that Apples new security polices (https://support.apple.com/en-ca/HT210650) are the cause of the issue. Currently I manage node through brew. It would make sense that NVM would work properly, if this change was the cause of the issue. I am currently using Xcode 11.1, and I have the terminal tools installed. ... Small update, I was able to get things working after installing node through NVM. However I still got an error until I removed the old modules in the project I am working on, and then reinstalled fresh copies. Which makes me unsure if NVM fixed the issue, or removing the old packages and lock fixed the issue. I thought I would write an update in case anyone else has problems after upgrading though. |
@markandrewj, would you mind to describe all the steps you made to fix the issue? after upgrading some packages and node, my app is no longer working since it's unable to be compiled by node-gyp rebuild. Thanks |
Hey @jonbondani, before doing any of the following steps I outline, make sure you have updated xcode, and opened xcode, so it can install the most recent compiler tools. If you haven't done this node-gyp won't be able to compile correctly. For me though, even after I installed the latest version of xcode, I still had the same issue. The issue happens because parts of / are now read only in Catalina, which has been causing issues for node-gyp. According to the issue referenced in this thread though, the issue should be fixed now. In the end, this is what worked for me:
As a note, one benefit you get from switching to NVM is the ability to add a .nvmrc to your project, which locks it to a specific node version. |
There are TWO ways to do this:
Both work but both have their idiosyncrasies. |
@cclauss I tied both of the methods you listed, before switching to NVM, without success. |
@markandrewj, I've reinstalled xcode comandtools, use nvm to install latest LTS node and followed all the steps that you suggested, but always the same result:
thanks |
I'm not sure any of the following will help, but they are things you could try.
If none of this helps, you will probably find further information by looking for results for the given error.
|
@jonbondani wrote:
This is not all of Xcode so my bet is that
|
@markandrewj @cclauss , on the first try:
Tried using Python 2.7 (as suggested) with the same result:
I'm starting to despair, I've been stuck for two days without being able to move forward |
I tried everything in this thread as well as the documentation posted by @cclauss but my issue was the my git repo local directory had a space in it "git repos". After removing the space I was able to install correctly. It appears that gyp doesn't handle spaces in git repository names very well. the error I was seeing: as you can see the directory starts with 'repos' and not 'git repos':
|
|
In case it helps someone: I still got the error although Xcode was installed on my machine. It works after executing `sudo xcode-select -s /Applications/Xcode.app/Contents/Developer. |
https://docs.npmjs.com/misc/config#unsafe-perm sudo npm i --unsafe-perm=true |
I know I have Mojave, but maybe that can help someone, i spent 2 day for gyp error In my case I downgraded node 13 to 11 .. and worked React Native Environment Info: |
@theigor cuz does not work for everybody, in my case the acid tests pass but I still got the issue |
It would be really cool if |
I did a full uninstall and reinstall of yarn, node, nvm and deleted my Downgrading the Node version with NVM helped. (I went from |
I solved the issue on my 16" MBP (clean Catalina install) by opening XCode, manually selecting the CLI install directory from the locations tab in preferences, then downgrading to node V11 using NVM. |
|
Thanks buddy |
That's true for me. I already had the xcode tools installed and didn't know why it was falling. It was a project that a coworker initialized on MS Windows. Running the following worked for me:
|
This issue seems to have ran its course. For people coming here through search engines: see https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md |
Spent tens of hours trying to solve it (not successful). So I have decided to dive into JS and Py code for debugging.
obviously I don't understand how it worked for others if there is an internal error in the core lib of node-gyp |
@eranhr You're probably using an old version of node-gyp / node-pre-gyp. Make sure your dependencies/resolutions are using a recent version. I use yarn and always add something like this:
If you're using npm instead of yarn, you can use npm-force-resolutions to use the same kind of forced dependency resolution behavior as yarn. One of the major benefits and major pitfalls of JS ecosystem is version pinning - however that sometimes results in old packages that don't ever get upgraded to use new versions of critical packages such as this. |
This worked for me. See the following, |
I fixed this by upgrading |
Thank bro, |
Try to add a |
I found this elsewhere and I have no idea what it does, but I deleted package-lock.js and package.js files and then ran this: npm i -g node-gyp@latest && npm config set node_gyp "/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js" And for some reason, that seems to have worked. When I tried to clone the same repo in a new directory and install it again, it was broken again with the same errors. Maybe I need to run that line of code every single time (??) but I'm afraid to do it again and break that one repo I got working in the first directory. EDIT: someone helped me by pointing out node-sass causes a lot of node-gyp errors. To fix it, I just had to install node-sass independently first before running 'node install' because it has tight native bindings to the version of Node you're using. |
Apple clang version 11.0.0 (clang-1100.0.20.17) Target: x86_64-apple-darwin19.0.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Verbose output (from npm or node-gyp):
2019-06-16T10_20_00_103Z-debug.log
2019-06-16T10_20_00_173Z-debug.log
The text was updated successfully, but these errors were encountered: