nodegit
nodegit copied to clipboard
error: failed to mmap. Could not write data: Permission denied
error: failed to mmap. Could not write data: Permission denied.
Getting this error while executing the following code
repository.fetchAll({
callbacks: {
certificateCheck: function () {
return 0;
},
credentials: function (_url: string, userName: string) {
return Git.Cred.sshKeyNew(
userName,
sshPublicKeyPath,
sshPrivateKeyPath,
''
);
}
}
})
This is most likely a file permission issue. Please fill out the issue template when submitting issues:
System information
- node version:
- npm or yarn version:
- OS/version/architecture:
- Applicable nodegit version:
node -v
npm -v # (or yarn -v)
node -e "console.log(process.platform)"
node -e "console.log(require('os').release())"
node -e "console.log(console.log(process.arch))"
I'm also getting this error when running yarn hardhat test on this repo, which uses nodegit to clone a repo.
node -v
v16.17.1
npm -v # (or yarn -v)
8.15.0
node -e "console.log(process.platform)"
linux
node -e "console.log(require('os').release())"
5.15.68.1-microsoft-standard-WSL2
node -e "console.log(console.log(process.arch))"
x64
undefined
Update: this SO answer solved the issue for me.