You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like nodegit can't be installed for Node v16? Can anyone confirm if they can?
Reacted by Samuel Ainsworth, Gustavo Sampaio, Pierric Cistac, uetchy, Thomas Dekiere, patrickp-dev, Łukasz Latusik, Michael Kolb, Thomas Jensen, John Firebaugh and 16 more
Maybe related to #1839 (or maybe that is just for electron),
although it works fine for me. Node v16.0.0 on Linux (PopOS 20.04). Tested with nodegit@next and nodegit@latest. Thought i cleared node_modules but apparently not, also experiencing problems with Node v16.
But I'm experiencing problems with my CI on Windows with Node v15 and nodegit@next, might be unrelated to your issue.
I think I'm having the same problem, (was testing via node on osx, but when run in docker with)
2021-05-04 10:32:39 > Error: The module '/TourCms/Cms/node_modules/nodegit/build/Release/nodegit.node'
2021-05-04 10:32:39 > was compiled against a different Node.js version using
2021-05-04 10:32:39 > NODE_MODULE_VERSION 72. This version of Node.js requires
2021-05-04 10:32:39 > NODE_MODULE_VERSION 93. Please try re-compiling or re-installing
2021-05-04 10:32:39 > the module (for instance, using `npm rebuild` or `npm install`).
dockerfile; FROM node:latest AS node_base
NODE Version: v16.0.0
Edit: disregard this, my github action was installing with v12 (72). Dockerfile latest. Setting both to v12 fixed my problem.
❯❯❯ npm i -S nodegit
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
added 164 packages, and audited 165 packages in 6m
8 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
node -v: v16.2.0 npm -v: 7.14.0 Platform: Win 10 with python 3.9.1 and VS build tools 2019
And in comparison with npm 7.15.0 on the current node LTS (14.17.0) on the same machine:
❯❯❯ npm i -S nodegit
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
added 164 packages, and audited 165 packages in 22s
8 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Not sure what is going on, but this is 16x increase in installation time. Also node 15 is the same as node 16 in this regard.
I too am having an issue installing nodegit on Node v16.3.0 on Mac OS Big Sur. It seems to install fine on Windows 10 though.
Reacted by Camille Louédoc-Eyriès, Björn Biege, Frederick Feibel, Julien Chaumond, Dezső Mészáros, Shane McLaughlin, Kyle a.k.a. TechSquidTV, Mike Cavaliere, Samuel Ainsworth, Geo Salameh and 6 more
I can install in a node 16 docker container, I can not on my Mac Mojave 10.14.6
info
npm ERR! spawn
npm ERR! make
npm ERR! gyp
npm ERR! info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../src/async_baton.cc:1:
npm ERR! In file included from ../src/../include/async_baton.h:5:
npm ERR! In file included from ../../nan/nan.h:58
npm ERR! :
npm ERR! In file included from /Users/<user>/Library/Caches/node-gyp/16.6.1/include/node/node.h:63:
npm ERR! In file included from /Users/<user>/Library/Caches/node-gyp/16.6.1/include/node/v8.h:30:
npm ERR! /Users/<user>/Library/Caches/node-gyp/16.6.1/include/node/v8-internal.h:488:38: error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'remove_cv'?
npm ERR! !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! ~~~~~^~~~~~~~~~~
npm ERR! remove_cv
npm ERR! /Library/Developer/CommandLineTools/usr/include/c++/v1/type_traits:660:50: note: 'remove_cv' declared here
npm ERR! template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
npm ERR!
npm ERR! ^
npm ERR!
npm ERR! 1 error generated.
npm ERR! make: *** [Release/obj.target/nodegit/src/async_baton.o] Error 1
npm ERR! gyp
npm ERR! ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp
npm ERR! ERR! stack at ChildProcess.onExit (/Users/<user>/.nvm/versions/node/v16.6.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:394:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 18.7.0
npm ERR! gyp ERR! command "/Users/<user>/.nvm/versions/node/v16.6.1/bin/node" "/Users/<user>/.nvm/versions/node/v16.6.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/<user>/Documents/GitHub/<project>/node_modules/nodegit/build/Release/nodegit.node" "--module_name=nodegit" "--module_path=/Users/<user>/Documents/GitHub/<project>/node_modules/nodegit/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93"
npm ERR! gyp ERR! cwd /Users/<user>/Documents/GitHub/<project>/node_modules/nodegit
npm ERR! gyp ERR! node -v v16.6.1
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok
For me, it seems the issue is the bin is building from source with Node Gyp and the issue is in here, though I don't fully understand what leads to this (on mac).
NVM could potentially have a part to play in the issue.
It looks like pre-built binaries are missing that could potentially help here:
npm ERR! 404 https://axonodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.27.0-node-v93-darwin-x64.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(404): https://axonodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.27.0-node-v93-darwin-x64.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp http 404 status code downloading tarball https://axonodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.27.0-node-v93-darwin-x64.tar.gz
npm ERR! gyp
Reacted by Samuel Ainsworth, Loïc Vernet, Douglas Nassif Roma Junior, Kipras Melnikovas and yukino2000
I wish nodegit wouldn't need native builds. Or at least not built with node-gyp. node-gyp has been a pain in the – you know, the place, where the sun doesn't shine. It's been problematic ever since its beginnings. It's complicated and the error messages and traces have never been any good. When using NPM, it's a nightmare and with yarn it's even worse.
Alternatively, you might want to think about an option to allow simple spawned calls to the git-cli.
I don't mind a few split seconds or maybe even seconds more, it would take nodegit to execute when running synchronously.
That's still more efficient than spending half a day chasing these pesky node-gyp compile errors.
Reacted by Jonas Erlandsson, rmd1710714107, Jianye Xi, Kipras Melnikovas and Srijan Mukherjee
@KyleTryon Seeing the same error with node v16.4.0, macOS 11.6, node-pre-gyp v0.13.0, node-gyp v4.0.0. You can see my full log here. The interesting bit however is
In file included from
../src/async_baton.cc:1:
In file included from ../src/../include/async_baton.h:5:
In file included from ../../nan/nan.h:58:
In file included from /Users/skainswo/.node-gyp/16.4.0/include/node/node.h:63:
In file included from /Users/skainswo/.node-gyp/16.4.0/include/node/v8.h:30:
/Users/skainswo/.node-gyp/16.4.0/include/node/v8-internal.h:454:38: error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'remove_cv'?
!std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
~~~~~^~~~~~~~~~~
remove_cv
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:776:50: note: 'remove_cv' declared here
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
^
1 error generated.
make: *** [Release/obj.target/nodegit/src/async_baton.o] Error 1
It's worth mentioning that building from source on the latest master (4561dcb at the time of writing) does work for me. So perhaps this issue has been fixed. However attempting to install that version fails: #1864.
I have since upgraded to Node v18 and installed nodegit v0.28.0-alpha.18, and it installed and runs fine. I know that's not a solution for everyone, but it might help someone.
Reacted by Christophe Pelé, Konstantin Kovalev, uetchy, Stefania, Kacee, Hieu Pham (Web SRE / Platform Pillar), Jiri Spac and test user
Could we have prebuilds for node 18? It is now LTS. Node 16 will be EOL in less than a year, whereas node 18 will be supported through 2025, so I would really like to use node 18, but installing from source can be a pain (and slow).
Reacted by Joshua Carter, Marc Arbesman, Jared Henderson, April Mintac Pineda, Kipras Melnikovas, Joy Gao, Johan Preynat, Al Johri and Anton Rieder
I have since upgraded to Node v18 and installed nodegit v0.28.0-alpha.18, and it installed and runs fine. I know that's not a solution for everyone, but it might help someone.
This nodegit version can also be installed with Node v16 on Mac M1
You may be able to install it, but you'll be compiling libgit2 from source. This bug is mainly about the fact that there are not prebuilt binaries available.
I'm getting this error on my Mac intel 12.6.3. It fails for me on both Node16 and Node19
yarn add nodegit
yarn add v1.22.19
[1/4] 🔍 Resolving packages...
warning nodegit > node-gyp > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning nodegit > [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
[1/2] ⡀ core-js
error /Users/aprilmintacpineda/myproject/node_modules/nodegit: Command failed.
Exit code: 1
Command: node lifecycleScripts/preinstall && node lifecycleScripts/install
Arguments:
Directory: /Users/aprilmintacpineda/myproject/node_modules/nodegit
Output:
[nodegit] Running pre-install script
[nodegit] Running install script
node-pre-gyp
info it worked if it ends with ok
node-pre-gyp
info using [email protected]
node-pre-gyp info using [email protected] | darwin | x64
node-pre-gyp WARN
Using request for node-pre-gyp https download
node-pre-gyp info check
checked for "/Users/aprilmintacpineda/myproject/node_modules/nodegit/build/Release/nodegit.node" (not found)
node-pre-gyp http GET https://axonodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.27.0-node-v111-darwin-x64.tar.gz
node-pre-gyp http 404
https://axonodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.27.0-node-v111-darwin-x64.tar.gz
node-pre-gyp WARN Tried to download(404): https://axonodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.27.0-node-v111-darwin-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v111 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://axonodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.27.0-node-v111-darwin-x64.tar.gz
gyp
info it worked if it ends with
ok
gyp info
using [email protected]
gyp
info using [email protected] | darwin | x64
gyp
info
ok
gyp
info
it worked if it ends with ok
gyp info
using [email protected]
gyp
info using [email protected] | darwin | x64
gyp
info
spawn /Library/Frameworks/Python.framework/Versions/2.7/bin/python2
gyp info spawn args
[
gyp info spawn args '/Users/aprilmintacpineda/myproject/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info
spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/aprilmintacpineda/myproject/node_modules/nodegit/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/aprilmintacpineda/myproject/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/aprilmintacpineda/.node-gyp/19.5.0/include/node/common.gypi',
gyp
info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/aprilmintacpineda/.node-gyp/19.5.0',
gyp
info spawn args '-Dnode_gyp_dir=/Users/aprilmintacpineda/myproject/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/aprilmintacpineda/.node-gyp/19.5.0/<(target_arch)/node.lib',
gyp
info spawn args '-Dmodule_root_dir=/Users/aprilmintacpineda/myproject/node_modules/nodegit',
gyp info spawn args '-Dnode_engine=v8',
gyp
info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp
info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info
spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp: Undefined variable standalone_static_library in binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack
at ChildProcess.onCpExit (/Users/aprilmintacpineda/myproject/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack at ChildProcess.emit (node:events:512:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12)
gyp ERR! System Darwin 21.6.0
gyp ERR! command "/Users/aprilmintacpineda/.nvm/versions/node/v19.5.0/bin/node" "/Users/aprilmintacpineda/myproject/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/aprilmintacpineda/myproject/node_modules/nodegit/build/Release/nodegit.node" "--module_name=nodegit" "--module_path=/Users/aprilmintacpineda/myproject/node_modules/nodegit/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v111"
gyp ERR! cwd /Users/aprilmintacpineda/myproject/node_modules/nodegit
gyp ERR! node -v v19.5.0
gyp ERR! node-gyp -v v4.0.0
gyp ERR! not ok
node-pre-gyp
ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/Users/aprilmintacpineda/.nvm/versions/node/v19.5.0/bin/node /Users/aprilmintacpineda/myproject/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/aprilmintacpineda/myproject/node_modules/nodegit/build/Release/nodegit.node --module_name=nodegit --module_path=/Users/aprilmintacpineda/myproject/node_modules/nodegit/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v111' (1)
node-pre-gyp ERR! stack
at ChildProcess.<anonymous> (/Users/aprilmintacpineda/myproject/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (node:events:512:28)
node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1098:16)
node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:304:5)
node-pre-gyp ERR! System Darwin 21.6.0
node-pre-gyp ERR! command "/Users/aprilmintacpineda/.nvm/versions/node/v19.5.0/bin/node" "/Users/aprilmintacpineda/myproject/node_modules/nodegit/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/aprilmintacpineda/myproject/node_modules/nodegit
node-pre-gyp
ERR! node -v v19.5.0
node-pre-gyp ERR! node-pre-gyp -v v0.13.0
node-pre-gyp ERR! not ok
Failed to execute '/Users/aprilmintacpineda/.nvm/versions/node/v19.5.0/bin/node /Users/aprilmintacpineda/myproject/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/aprilmintacpineda/myproject/node_modules/nodegit/build/Release/nodegit.node --module_name=nodegit --module_path=/Users/aprilmintacpineda/myproject/node_modules/nodegit/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v111' (1)
[nodegit] ERROR - Could not finish install
[nodegit] ERROR - finished with error code: 1
I'm also getting an error installing the alpha version
Figma is apparently (unofficially, for their own use, I assume) offering pre-built binaries that work with Node.js v18 on their fork: https://www.npmjs.com/package/@figma/nodegit
Credit goes to Figma an @jfirebaugh (and the people at Figma) whose branch is the base for their current release. Thank you!
Activity
weedz commentedon Apr 29, 2021
Maybe related to #1839 (or maybe that is just for electron),
although it works fine for me. Node v16.0.0 on Linux (PopOS 20.04). Tested with nodegit@next and nodegit@latest.Thought i cleared node_modules but apparently not, also experiencing problems with Node v16.But I'm experiencing problems with my CI on Windows with Node v15 and nodegit@next, might be unrelated to your issue.
benjaminbhollon commentedon Apr 30, 2021
@garyking I'm having problems with that too
implausible commentedon Apr 30, 2021
We'll get this addressed in 0.28.0.
SoylentGraham commentedon May 4, 2021
I think I'm having the same problem, (was testing via node on osx, but when run in docker with)
dockerfile;
FROM node:latest AS node_baseNODE Version: v16.0.0Edit: disregard this, my github action was installing with v12 (72). Dockerfile latest. Setting both to v12 fixed my problem.
ci(node-version): dropped testing in node v16 for now
Rainrider commentedon May 28, 2021
I works for me, it just takes A LOT of time:
node -v: v16.2.0npm -v: 7.14.0Platform: Win 10 with python 3.9.1 and VS build tools 2019And in comparison with npm 7.15.0 on the current node LTS (14.17.0) on the same machine:
Not sure what is going on, but this is 16x increase in installation time. Also node 15 is the same as node 16 in this regard.
edwardcasbon commentedon Jun 18, 2021
I too am having an issue installing
nodegiton Nodev16.3.0on Mac OS Big Sur. It seems to install fine on Windows 10 though.KyleTryon commentedon Aug 9, 2021
I can install in a node 16 docker container, I can not on my Mac Mojave 10.14.6
For me, it seems the issue is the bin is building from source with Node Gyp and the issue is in here, though I don't fully understand what leads to this (on mac).
NVM could potentially have a part to play in the issue.
It looks like pre-built binaries are missing that could potentially help here:
mkastner commentedon Sep 24, 2021
I wish nodegit wouldn't need native builds. Or at least not built with node-gyp. node-gyp has been a pain in the – you know, the place, where the sun doesn't shine. It's been problematic ever since its beginnings. It's complicated and the error messages and traces have never been any good. When using NPM, it's a nightmare and with yarn it's even worse.
Alternatively, you might want to think about an option to allow simple spawned calls to the git-cli.
I don't mind a few split seconds or maybe even seconds more, it would take nodegit to execute when running synchronously.
That's still more efficient than spending half a day chasing these pesky node-gyp compile errors.
samuela commentedon Oct 14, 2021
@KyleTryon Seeing the same error with node v16.4.0, macOS 11.6, node-pre-gyp v0.13.0, node-gyp v4.0.0. You can see my full log here. The interesting bit however is
A little bit of googling confirmed that this is in fact a compatibility issue with node v16, and other packages have hit this same error: https://stackoverflow.com/questions/67241196/error-no-template-named-remove-cv-t-in-namespace-std-did-you-mean-remove
samuela commentedon Oct 14, 2021
It's worth mentioning that building from source on the latest master (4561dcb at the time of writing) does work for me. So perhaps this issue has been fixed. However attempting to install that version fails: #1864.
samuela commentedon Oct 14, 2021
npm i [email protected]does work, so I think this issue can be closed once 0.28.0 is released!garyking commentedon Oct 14, 2021
Is that version stable? The repo hasn't been updated since that version, in June, so I wouldn't hold my breath for another version any time soon.
weedz commentedon Oct 14, 2021
I think it's stable enough. The only breaking change seems to be Cred being renamed to Credential (possibly some other minor api changes?).
I've been using the alpha versions for a while and have not experienced any problems.
samuela commentedon Oct 14, 2021
Any word on when the next release will be cut?
17 remaining items
marcelmanz commentedon Jun 20, 2022
this does not work properly for me :(
garyking commentedon Jun 22, 2022
I have since upgraded to Node v18 and installed
nodegit v0.28.0-alpha.18, and it installed and runs fine. I know that's not a solution for everyone, but it might help someone.pin notegid version
Yogu commentedon Nov 3, 2022
Could we have prebuilds for node 18? It is now LTS. Node 16 will be EOL in less than a year, whereas node 18 will be supported through 2025, so I would really like to use node 18, but installing from source can be a pain (and slow).
blv-rodrigoerades commentedon Dec 7, 2022
[email protected]works for me on Mac M1 Pro with nodev18.11.0perqa commentedon Feb 15, 2023
This nodegit version can also be installed with Node v16 on Mac M1
jfirebaugh commentedon Feb 15, 2023
You may be able to install it, but you'll be compiling libgit2 from source. This bug is mainly about the fact that there are not prebuilt binaries available.
aprilmintacpineda commentedon Feb 16, 2023
I'm getting this error on my Mac intel 12.6.3. It fails for me on both Node16 and Node19
yarn add nodegit
I'm also getting an error installing the alpha version
yarn add [email protected]
SFantasy commentedon Mar 2, 2023
Downgrade to Node v12 works for
[email protected]03hgryan commentedon Aug 3, 2023
This works! Thank you very much!!
aried3r commentedon Aug 22, 2023
Figma is apparently (unofficially, for their own use, I assume) offering pre-built binaries that work with Node.js v18 on their fork: https://www.npmjs.com/package/@figma/nodegit
Credit goes to Figma an @jfirebaugh (and the people at Figma) whose branch is the base for their current release. Thank you!
ayushi-singhal commentedon Oct 10, 2023
Which version of NodeGit should be used now with Node JS v18.17.1?
@0.28.0-alpha.21given on https://github.com/nodegit/nodegit@0.28.3mentioned on https://www.npmjs.com/package/nodegit as stable version@0.27.0as official version on https://www.npmjs.com/package/nodegitseasonedfish commentedon Oct 14, 2023
Experienced this issue with MacBook Air M1 (2020), Node v18.18.0. Using figma's nodegit (0.28.0-figma.4) worked.
ayushi-singhal commentedon Oct 16, 2023
@seasonedfish Is (0.28.0-figma.4) a production ready version?
seasonedfish commentedon Oct 17, 2023
Sorry, I don't know if they make any guarantees of their release being production ready.