Skip to content
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

Failing to install aframe from npm #5145

Open
diarmidmackenzie opened this issue Nov 4, 2022 · 14 comments
Open

Failing to install aframe from npm #5145

diarmidmackenzie opened this issue Nov 4, 2022 · 14 comments

Comments

@diarmidmackenzie
Copy link
Contributor

Description:

  • A-Frame Version: 1.3.0
  • Platform / Device: Windows
  • Reproducible Code Snippet or URL: "npm install aframe"
C:\Users\ASUS\Documents\GitHub\Test\test-physics-2>npm install aframe
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://[email protected]/ngokevin/debug.git
npm ERR! [email protected]: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ASUS\AppData\Local\npm-cache\_logs\2022-11-04T16_09_03_570Z-debug-0.log

I found these issues, which seem similar:
#4329
#5057

Tried adding this to my .gitconfig as per #5057

[url "https://"]
	insteadOf = git://

But this hasn't helped. I get the same error.

I'll upload verbose output from the command (with that change to .gitconfig applied)

npm info using [email protected]
npm info using [email protected]

2022-11-04T16_26_54_020Z-debug-0.log

@diarmidmackenzie
Copy link
Contributor Author

If I run the problematic command directly, it asks for the passphrase for my SSH key, and then seems to work successfully.

C:\Users\ASUS\Documents\GitHub\Test\test-physics-2>git --no-replace-objects ls-remote ssh://[email protected]/ngokevin/debug.git
Enter passphrase for key '/c/Users/ASUS/.ssh/id_ed25519':
9742c5f383a6f8046241920156236ade8ec30d53        HEAD
9742c5f383a6f8046241920156236ade8ec30d53        refs/heads/master
ef5f8e66d49ce8bc64c6f282c15f8b7164409e3a        refs/heads/noTimestamp
fc068941f030373f51aac24d3fd9ce4760aba300        refs/heads/v3
497a088b5f7a48a0c2ef10c8bd5aaf06e0f9d129        refs/tags/0.1.0
207be096d3fb98580ff074fc5fab13633905120c        refs/tags/0.2.0
b07efa967cccfe7cb52b14471c5e2994ac65e27b        refs/tags/0.3.0
a73176b16872ac4b7f904d23ed88b02a8ec17fa2        refs/tags/0.4.0
etc...

diarmidmackenzie added a commit to diarmidmackenzie/aframe-physics-system that referenced this issue Nov 4, 2022
I'm not able to fully test npm install at this point due to problems with aframe dependencies:
aframevr/aframe#5145
@kylebakerio
Copy link
Contributor

npm install aframe works for me. I'm on npm 8.15.0, node v16.17.1, Pop OS (linux>debian>ubuntu>pop).

@vincentfretin
Copy link
Contributor

It works on Ubuntu 22.04 node v16.18.0 npm 8.19.2 with my ssh rsa key without passphrase.

@dmarcos
Copy link
Member

dmarcos commented Nov 7, 2022

not sure what's special about that configuration. anything that should be done on A-Frame side?

@kylebakerio
Copy link
Contributor

kylebakerio commented Nov 7, 2022

It sounds like an npm problem, but it is weird. I wonder if it was a temporary github server blip? Did you experience the failure multiple times, diarmid? Does it reproduce if you do it again in a clean directory?

@dmarcos
Copy link
Member

dmarcos commented Nov 8, 2022

Can i close this or there's something we need on A-Frame side?

@diarmidmackenzie
Copy link
Contributor Author

This is not a transient thing - it is still broken for me, meaning I can't do aything with npm + a-frame at the moment.

Something that potentially would help would be migrating all the dependencies in package.json to reference NPM packages rather than GitHub URLs.

https://docs.npmjs.com/cli/v8/configuring-npm/package-json#github-urls

This, for instance
"debug": "ngokevin/debug#noTimestamp",

This would require all the dependencies being published to npm:

    "debug": "ngokevin/debug#noTimestamp",
    "three-bmfont-text": "dmarcos/three-bmfont-text#21d017046216e318362c48abd1a48bddfb6e0733",        
    "markserv": "github:sukima/markserv#feature/fix-broken-websoketio-link",
    "too-wordy": "ngokevin/too-wordy",

Having a single mechanism for installing everything would definitely reduce surface area in terms of things that can go wrong.

@diarmidmackenzie
Copy link
Contributor Author

OK - finally got round to trying Vincent's suggestion of using SSH keys without a passphrase, and I have now progressed to a new error:

C:\Users\ASUS\Documents\GitHub\Test\test-physics-2>npm install aframe
npm ERR! code 1
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects clone -b noTimestamp ssh://[email protected]/ngokevin/debug.git C:\Users\ASUS\AppData\Local\npm-cache\_cacache\tmp\git-cloneCXperv --recurse-submodules --depth=1 --config core.longpaths=true
npm ERR! Cloning into 'C:\Users\ASUS\AppData\Local\npm-cache\_cacache\tmp\git-cloneCXperv'...
npm ERR! git: 'submodule' is not a git command. See 'git --help'.

@diarmidmackenzie
Copy link
Contributor Author

If I run this command by itself, it is successful...

git --no-replace-objects clone -b noTimestamp ssh://[email protected]/ngokevin/debug.git C:\Users\ASUS\AppData\Local\npm-cache\_cacache\tmp\git-cloneCXperv --recurse-submodules --depth=1 --config core.longpaths=true

@vincentfretin
Copy link
Contributor

A different issue, but so that you are aware, it seems that the "github:" prefix may be an issue for some people, Someone reported he couldn't install networked-aframe because of this, he was using ubuntu and node 14 but I don't know how he installed node. I didn't have the issue myself on ubuntu 22.04 and node 16. Using the other github syntax fixed the issue for him, see networked-aframe/networked-aframe#375 for details.

@vincentfretin
Copy link
Contributor

Probably not the same git binary that is executed with npm? I know you had an issue also with husky and bash last time.

@diarmidmackenzie
Copy link
Contributor Author

diarmidmackenzie commented Nov 9, 2022

OK, I have "solved" this by:

Adding this to my .gitconfig

[url "https://"]
	insteadOf = git://
        insteadOf = ssh://

And adding this to my path (to deal with an error git: 'remote-https' is not a git command)

C:\Program Files\Git\mingw64\libexec\git-core

(as per this comment desktop/desktop#10345 (comment) )

@diarmidmackenzie
Copy link
Contributor Author

diarmidmackenzie commented Nov 9, 2022

It looks like the path update to include "C:\Program Files\Git\mingw64\libexec\git-core" was the critical bit.

Things are now working without this line in .gitconfig

 insteadOf = ssh://

I haven't gone back and tested all combination, but it looks like there's 2 different routes I could have taken to get this working:

1. Do everything over HTTPS

a) Add this to .gitconfig

[url "https://"]
	insteadOf = git://
        insteadOf = ssh://

b) Extend path to include "C:\Program Files\Git\mingw64\libexec\git-core"

2. Use SSH

a) No changes to .gitconfig

b) Create SSH keys locally, without a passphrase and add them to my GitHub account, as per instructions here

(if I'd been able to get ssh-agent working, maybe I could have used a passphrase)

c) Extend path to include "C:\Program Files\Git\mingw64\libexec\git-core"

@diarmidmackenzie
Copy link
Contributor Author

In terms of what's needed for A-Frame, I'd say there's nothing essential, as it seems there are ways to muddle through issues that may arise.

But the overall installation would be less vulnerable to problems if it was standardized on a single method of package download, so it would be desirable to move to a position where all dependencies are npm packages, and downloaded from npm.

I think it's also desirable for dependencies like ngokevin/debug to be brought under the A-Frame umbrella, rather than being left to be maintained (or not) by someone no longer associated with A-Frame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants