npm / npm

This repository is moving to: https://github.com/npm/cli
http://npm.community
17.54k stars 3.02k forks source link

[regression] npm can not find package.json in git repository #19409

Open dotnetCarpenter opened 6 years ago

dotnetCarpenter commented 6 years ago

I'm opening this issue because:

What's going wrong?

npm can not find package.json in git repository

How can the CLI team reproduce the problem?

  1. npm i -g git@github.com:dotnetCarpenter/node-ecstatic.git

Gist of log: https://gist.github.com/dotnetCarpenter/2f0c5c7ebb38b0db331ed20489562cba

supporting information:

dotnetCarpenter commented 6 years ago

With yarn I get:

yarn global add  git@github.com:dotnetCarpenter/node-ecstatic.git
yarn global v1.3.2
[1/4] Resolving packages...
error Command failed.
Exit code: 128
Command: git
Arguments: ls-remote --tags --heads github.com:dotnetcarpenter/node-ecstatic.git
Directory: /home/dotnet/projects/napp/loader
Output:
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

This might be an issue with a change on github.com?

Or it might be related to #16854

dotnetCarpenter commented 6 years ago

OK, this just seems very wrong:

7 silly fetchPackageMetaData error for git@file:github.com:dotnetCarpenter/node-ecstatic.git Could not install from "github.com:dotnetCarpenter/node-ecstatic.git" as it does not contain a package.json file.
8 verbose stack Error: ENOENT: no such file or directory, open '/home/dotnet/projects/napp/loader/github.com:dotnetCarpenter/node-ecstatic.git/package.json'
vdhpieter commented 6 years ago

I have the same issue (with another package) where you able to resolve it?

vdhpieter commented 6 years ago

Just tried this with npm v5.5.1 and it seems to work for me, so probably a bug in 5.6.0

dotnetCarpenter commented 6 years ago

@vdhpieter No. I haven't resolved it. I instead installed from my local folder. The work around was fine because I was just testing a forked project but not sustainable solution. Most use-cases will be in distributed package.json but this is currently broken. Since it works in 5.5.1, it's a regression. Bad bad npm