eligrey / FileSaver.js

An HTML5 saveAs() FileSaver implementation
https://eligrey.com/blog/saving-generated-files-on-the-client-side/
Other
21.63k stars 4.38k forks source link

Private package issue? #702

Open fingerskier opened 3 years ago

fingerskier commented 3 years ago

This shows up in my dependency tree after an update: ├── file-saver@1.3.8 (git+ssh://git@github.com/eligrey/FileSaver.js.git#e865e37af9f9947ddcced76b549e27dc45c1cb2e)

...which kills the CD workflow because it doesn't have access. Is there a workaround? The root package is actually jspdf so do I need to go to them?

Sleavely commented 3 years ago

Same here, jspdf@1.5.3 uses 1.3.8 from Github, but then fails because the tarball doesn't have the files in the root directory:

npm ERR! Could not install from "node_modules/jspdf/file-saver@github:eligrey/FileSaver.js#1.3.8" as it does not contain a package.json file.

If @eligrey could update the assets for that release on Github it would be 💯 🎉 .

makc commented 3 years ago

@Sleavely how could they update it when it points to specific commit (e865e37) ? but jspdf could point it to a different commit that does have package.json actually, wait a sec - that commit does have package.json

this command

npm install git+ssh://git@github.com/eligrey/FileSaver.js.git#e865e37af9f9947ddcced76b549e27dc45c1cb2e

works just fine for me / ¢5

Sleavely commented 3 years ago

@makc Fair question :) Like you discovered, the actual commit/tag is fine and that's why I suspect that it's trying to download the zip or tarball from the release page.

When you create a release on Github you have the ability to upload individual files such as compiled binaries or zipfiles, and those are - as far as I know - possible to edit retroactively because the release page is basically just a blog post managed independently from Git.

Edit: Looks like the source archives on the release page are automatically generated by Github, so NPM should be used to their format.. What the heck.

Sleavely commented 3 years ago

Like @makc above, installing it explicitly seems to do the trick, for somereason 😕

npm i 'file-saver@github:eligrey/FileSaver.js#1.3.8'
revatim commented 3 years ago

Is this resolved ? I deleted my package-lock.json and reran the npm install command. that seemed to work for me

ziaulrehman40 commented 3 years ago

Any permament fix? I am hitting this when using jspdf

AninditaDe commented 3 years ago

+1 @ziaulrehman40
I got the same error, when using jspdf any solution for this ?

igorya76 commented 3 years ago

encountering similar issue, i can get to install correctly locallly, but fails when i try to npm install in production on heroku

Qarun-Qadir-Bissoondial commented 2 years ago

I can confirm that this works locally but still encounters the same error message in my Gitlab CI. Did anyone have any luck updating to the latest versions and see if that helps?

wdgrantham commented 2 years ago

I came across this same issue today. Adding the the dependency to my package.json file as suggested by @Sleavely did the trick for me. I never had problems with building my repo locally, only in my CI process.

Beltarm commented 2 years ago

I also have this problem in my CI build to heroku, I tried to add it as a normal dependency and as resolution, it didn't work, was anyone able to fix it?

eligrey commented 2 years ago

I'll make a new release soon to fix this

kodali444 commented 2 years ago

Hi Team, I got this issue when my friend installed qrcode.react in the project. so in his system he use (node version: 16.14.2) In my system I used node version (12.18.3). so when tried to run "npm i" I got above error. Issue fixed in my system:

  1. I removed node_modules folder and installed node 16.14.2 version in my system & run "npm i" it's working fine now(here both my friend and Mine systems are UBUNTU versions).

NOTE: In mac I did not get any issue even my node version is 14.7.0 . So I tried in my ubuntu system with 14.7.0 node version no luck.

didierganthier commented 1 year ago

This resolved my issue, it was related to deploying on Vercel, I don't even know why but doing this fixed my deployment 👇🏽 https://github.com/eligrey/FileSaver.js/issues/702#issuecomment-859357568

Diaz006 commented 1 year ago

Haré una nueva versión pronto para arreglar esto.

:C

maksxp commented 1 year ago

Hi all. I've got the same error on aws yesterday - deleting package-lock.json (revatim commented on Jun 28, 2021) and installing version 1.3.8 (Sleavely commented [on Jun 11, 2021) didn't help. I'll appreciate for any updated solution of this error.

aqibbasheer commented 1 year ago

Is this resolved ? I deleted my package-lock.json and reran the npm install command. that seemed to work for me

maksxp commented 1 year ago

Hi all. I've got the same error on aws yesterday - deleting package-lock.json (revatim commented on Jun 28, 2021) and installing version 1.3.8 (Sleavely commented [on Jun 11, 2021) didn't help. I'll appreciate for any updated solution of this error.

finally this issue has been fixed by updating package-lock.json BEFORE ......... "jspdf": { ..... , "requires": { "file-saver": "file-saver@github: https: // github.com /eligrey /FileSaver.js /issues /1.3.8", ........

AFTER ........ "jspdf": { ..... , "requires": { "file-saver": "^2.0.1", // the same version as in my package.json file ........

Hope it will help someone )))

OlegZavrazhin commented 2 months ago

@maksxp Could you share your commands?

I tried to delete node_modules and package-lock.json and after installing packages still having in lock:

jspdf": {
      "version": "1.5.3",
      "resolved": "https://registry.npmjs.org/jspdf/-/jspdf-1.5.3.tgz",
      "integrity": "sha512-J9X76xnncMw+wIqb15HeWfPMqPwYxSpPY8yWPJ7rAZN/ZDzFkjCSZObryCyUe8zbrVRNiuCnIeQteCzMn7GnWw==",
      "requires": {
        "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"
      },
      "dependencies": {
        "file-saver": {
          "version": "github:eligrey/FileSaver.js#e865e37af9f9947ddcced76b549e27dc45c1cb2e",
          "from": "github:eligrey/FileSaver.js#1.3.8"
        }
      }
    }