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

file-saver package-lock method requires ssh to github #2208

Closed
rhanka opened this issue Dec 28, 2018 · 80 comments
Closed

file-saver package-lock method requires ssh to github #2208

rhanka opened this issue Dec 28, 2018 · 80 comments

Comments

@rhanka
Copy link

rhanka commented Dec 28, 2018

Thank you for submitting an issue to jsPDF. Please read carefully.

Are you using the latest version of jsPDF?
I had to rollback to 1.4.1 because of this bog

Have you tried using jspdf.debug.js?

Steps to reproduce
just compile from somewhere you don't have direct ssh access to github

Ideally a link too. Try fork this http://jsbin.com/rilace/edit?html,js,output

What I saw

15:49:10 npm ERR! Error while executing:
15:49:10 npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git
15:49:10 npm ERR!
15:49:10 npm ERR! ssh: Could not resolve hostname github.com: Name or service not known
15:49:10 npm ERR! fatal: Could not read from remote repository.
15:49:10 npm ERR!
15:49:10 npm ERR! Please make sure you have the correct access rights
15:49:10 npm ERR! and the repository exists.
15:49:10 npm ERR!
15:49:10 npm ERR! exited with error code: 128

What I expected
No ssh git access, only https method

My analysis
Not an npm expert but i saw this change btw 1.4.1 and 1.5.3 and 1.5.3 does'nt seem standard :
in package-lock.json:
1.4.1

    "file-saver": {
      "version": "1.3.8",
      "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-1.3.8.tgz",
      "integrity": "sha512-spKHSBQIxxS81N/O21WmuXA2F6wppUCsutpzenOeZzOCCJ5gEfcbqJP983IrpLXzYmXnMUa6J03SubcNPdKrlg=="
    },
    "file-saver": {
     "version": "github:eligrey/FileSaver.js#e865e37af9f9947ddcced76b549e27dc45c1cb2e",
     "from": "github:eligrey/FileSaver.js#1.3.8"
    },

npmjs.org registry should probably be used instead of github ? this is the only package using this method.

@rhanka rhanka changed the title file-saver package-lock method requires git file-saver package-lock method requires ssh git Dec 28, 2018
@rhanka rhanka changed the title file-saver package-lock method requires ssh git file-saver package-lock method requires ssh to github Dec 28, 2018
@Uzlopak
Copy link
Collaborator

Uzlopak commented Dec 28, 2018

#2203

@Uzlopak Uzlopak closed this as completed Dec 28, 2018
@rhanka
Copy link
Author

rhanka commented Dec 28, 2018

thx !!

@Uzlopak
Copy link
Collaborator

Uzlopak commented Jan 1, 2019

I will revert the change and reopen the issue, because you reported it wrong. npm installs http://registry.npmjs.org/file-saver/-/file-saver-1.3.8.tgz, which contains 1.3.2 and not 1.3.8.

@Uzlopak Uzlopak reopened this Jan 1, 2019
@Uzlopak Uzlopak added the Bug label Jan 1, 2019
@amitoh
Copy link

amitoh commented Jan 6, 2019

he reported it fine, enterprise organizations block ssh request and use a custom artifact store,
I think using version 1.3.2 is preferable to not being able to use jsPDF altogether

@Uzlopak
Copy link
Collaborator

Uzlopak commented Jan 6, 2019

I will make an appropriate fix. Something were I will get a working copy of jspdf. Just because a big company is too lazy to install openssl or mbedtls doesn't mean that the majority has to suffer.

@jnardone
Copy link

+1 on this - our build images intentionally don't have git, so we should be able to install just from npmjs. we are similarly downgraded to 1.4.1.

@Uzlopak
Copy link
Collaborator

Uzlopak commented Jan 17, 2019

I will fix the stuff till the end of the week. Then you can hopefully progress

@averypan503
Copy link

averypan503 commented Jan 22, 2019

so 1.5.3 still use file-saver from github and need git? That's wrong behavior as in server do not need install git. And we also need downgrade the version which use file-saver not from github.

"dependencies": {

    "canvg": "1.5.3",

    "file-saver": "github:eligrey/FileSaver.js#1.3.8",

    "html2canvas": "1.0.0-alpha.12",

    "omggif": "1.0.7",

    "promise-polyfill": "8.1.0",

    "stackblur-canvas": "2.2.0"

  },

@Roshdy
Copy link

Roshdy commented Jan 23, 2019

Is ther any workaround for this? I tried 1.3.2, has the same problem.

I even tried 1.5.2, which throws an error while making an instance: var doc = new jsPDF();

TypeError: Cannot read property 'charAt' of undefined
    at new e (jspdf.min.js:9492)

I'm stuck!

@Uzlopak
Copy link
Collaborator

Uzlopak commented Jan 24, 2019

because everyone is complaining... i reverted to 1.3.8 directly but with the result,that probably the buid will fail. Maybe I should put file-saver as dev dependency.

@ozakha
Copy link

ozakha commented Feb 8, 2019

Please, tag this changes - reinstall still looks on v.1.5.3 as latest but this is not true

@mremolt
Copy link

mremolt commented Feb 20, 2019

Package file-saver released V2.0.1 a few days ago. Maybe this solves the problems?

@amroessam
Copy link

I have the same issue occurring with me, it's trying to fetch file-saver from git, can you please revert to the npm version?

@chandrasekharu
Copy link

chandrasekharu commented Mar 12, 2019

has anyone found a fix for this issue. I too having the same issue during installing node modules with

npm install getting the same error

for installing jspdf it throws error like this

$ npm install jspdf --save
npm ERR! Error while executing:
npm ERR! C:\Program Files\Git\mingw64\bin\git.EXE ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git
npm ERR!
npm ERR! ssh: Could not resolve hostname github.com: Name or service not known
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!
npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:
npm ERR! debug.log

@SupernaviX
Copy link

@arasabbasi please bump the jsPDF version number in package.json and create a new release. I think that npm install will work fine on master, but we can't use that until you make a release out of it.

@Uzlopak
Copy link
Collaborator

Uzlopak commented Mar 20, 2019

I know your pain. But I am on making Changes so that we have in a week or so a new stable. And tbh file-saver on npm is faulty. Have to see if latest file-saver is gonna work or not.

@Uzlopak
Copy link
Collaborator

Uzlopak commented Mar 23, 2019

Fixed with #2333

@Uzlopak Uzlopak added the Fixed label Mar 23, 2019
@AnthonyPhan
Copy link

AnthonyPhan commented Feb 5, 2020

Same issue here. why has this been marked as closed?

@tenadolanter
Copy link

tenadolanter commented Mar 1, 2020

getting the same error

jspdf version is 1.5.3, it has a dependencies "file-saver": "eligrey/FileSaver.js#1.3.8", who cause the error

  "dependencies": {
    "canvg": "1.5.3",
    "file-saver": "eligrey/FileSaver.js#1.3.8",
    "html2canvas": "1.0.0-alpha.12",
    "omggif": "1.0.7",
    "promise-polyfill": "8.1.0",
    "stackblur-canvas": "2.2.0"
  }

so now is year 2020, has anyone found fix yet ?

@kishore075
Copy link

Hi,

same error any update on how to fix this issue?

Capture

@m-haziq
Copy link

m-haziq commented Apr 17, 2020

I was getting the same issue, I followed these steps carefully after making sure I had version "jspdf": "^1.5.3":

  1. Added this to package.json "file-saver": "^2.0.2" .
  2. Inside my package-lock.json, I searched for "jspdf" entry and inside it:
    • Removed this line from "requires" "file-saver": "github:eligrey/FileSaver.js#1.3.8"
    • Added these lines to "dependencies"
      "file-saver": {
        "version": "2.0.2"
      }
    
  3. Deleted the folder "node_modules" and ran npm install again. This automatically fixes my "package-lock.json".

I dont think this is that bad solution but when you install a new package, it revert the package-lock.json back, so you have to keep a check on that. Anyways thanks be to this answer: #2208 (comment)

@kishore075
Copy link

Hi @m-haziq thanks that worked i cam install 1.4.1

@hitautodestruct
Copy link

Has anybody been working on this issue?
This is still happening although @m-haziq solution is working it is very fragile in a working env.

@martinderm
Copy link

martinderm commented Jun 8, 2020

2020 checking in, apparently this is still a problem scnr
Thanks for your code, though.

@alexey13
Copy link

The problem is that to install from github you should have git in variables list of your machine.
Follow instructions
In my case the git was in program files folder
After restart cmd and try to install jspdf again

@kbreezy04
Copy link

@alexey13 And for those of us that need an entirely offline build?

@alexey13
Copy link

How can you install any package from npm offline? After you installed packages you can build offline, I think.

@kbreezy04
Copy link

You shouldn't rely on your NPM cache to build on your CI server. NPM offline caching methods, for instance Yarn offline mirror, won't cache dependencies from Git links. So that's not an option. You can use something like Artifactory, but the Git links break Artifactory unless you set up dependency re-writes. Unfortunately the link in jspdf package.json to FileSaver is not standard and breaks Artifactory re-write. This isn't just a problem with "big companies being lazy", any company should be fully offlining dependencies and having a Git link in your package.json breaks that.

@HackbrettXXX
Copy link
Collaborator

With #2804 there will be no dependencies to GitHub anymore. And there will be a new release soon :)

@dhaneshRaj
Copy link

m-haziq commented on Apr 17 •
Thanks bro its working... i think uninstall node js install latest it may work...

@ghost
Copy link

ghost commented Aug 10, 2020

@HackbrettXXX Hi, When will we get the new release? Any dates?

@HackbrettXXX
Copy link
Collaborator

Hopefully this week.

@ghost
Copy link

ghost commented Aug 10, 2020

@HackbrettXXX Thanks... Please do it... Though we can workaround this in local boxes by following above said workarounds, it is clumsy to maintain this package in CI/CD pipelines without your fix.

@monicat2504
Copy link

@HackbrettXXX is it released yet?

@HackbrettXXX
Copy link
Collaborator

@laazaz
Copy link

laazaz commented Dec 15, 2020

I've fixed this by allowing GIT 9418 port and 22 port on the firewall settings, I don't know which fixed the problem though.

@TheFrogPrince
Copy link

Are you using the latest version of jsPDF? I had to rollback to 1.4.1 because of this bog

we got away with just rolling back to 1.5.2. Definitely remove the ^ in the reference in the package.json file. Going up to the 2.0 version started causing other obscure issues in the build. Not worth tracking down why.

@charanjit-singh
Copy link

image

"file-saver": "^2.0.5",

@omprakash-sit
Copy link

I am facing the same issue, when running yarn install command getting below error..

  warning Pattern ["file-saver@eligrey/FileSaver.js#1.3.8"] is trying to unpack in the same destination "C:\\Users\\[xyz]\\AppData\\Local\\Yarn\\Cache\\v1\
  pm-file-saver-2.0.5-cea522bc41bfadc364837293d0c4dc585a65ac46" as pattern ["file-saver@github:eligrey/FileSaver.js"]. This could result in non-deterministic behavior, skipping.
  error Command failed.
  Exit code: 128
  Command: git
  Arguments: ls-remote --tags --heads ssh://git@github.com/eligrey/FileSaver.js.git
  Directory: C:\Users\[xyz]\git\[repo]
  Output:
  git@github.com: Permission denied (publickey).
  fatal: Could not read from remote repository.

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

No branches or pull requests