Giter Club home page Giter Club logo

Comments (8)

AnzuTwo avatar AnzuTwo commented on May 8, 2024 1

Sorry - It looks like I was in fact using 2.3.0. I've updated to 2.3.1, I think. (As you can clearly tell, I am not at all a software developer haha)

I added npx to the command but I'm still seeing the same error. It does reference the new helpers.js file now though.

PS C:\Users\<UserName>\Documents\<Folder>\new> staticrypt --version
2.3.1

PS C:\Users\<UserName>\Documents\<Folder>\new> npx staticrypt .\proveYourself.html <Password>
C:\Users\<UserName>\Documents\<Folder>\new\node_modules\staticrypt\cli\helpers.js:123 .replaceAll(/^.*\brequire\(.*$\n/gm, ""); ^

TypeError: fs.readFileSync(...).replaceAll is not a function

from staticrypt.

robinmoisson avatar robinmoisson commented on May 8, 2024 1

Got it! I think. What's your node version, is it lower than 16?

I could reproduce in node 12, it looks like String.replaceAll doesn't exist in this node version.

I've just uploaded the patch in 2.3.2 - let me know if that fixes it for you.

from staticrypt.

cumbriasingers avatar cumbriasingers commented on May 8, 2024 1

Better than awesome. All working perfectly this morning - thanks so much for your swift response. And, of course, for all the work hitherto!

from staticrypt.

robinmoisson avatar robinmoisson commented on May 8, 2024

Thanks for reporting - which version of staticrypt are you using? If you're on >=2.2 there has been some changes to the code in the past few weeks and lots of refactoring, an edge case bug might have gone through.

I tried to copy your directory structure but can't reproduce your issue so far. Where are you calling the npx command from, is that the root directory of your project?

I did noticed there was a function that didn't handle filepath exactly properly, I couldn't hit a bug with it but maybe that caused an issue in your case. I've made the function more resilient and added more verbose logging to the error you encountered - I've just pushed it to 2.3.1 on npm. Can you update and let me know how it goes?

If you need to have a working version asap you can also downgrade to <2.2 (~2.1.1), which is before the recent changes, but I'd be interested to understand what's going wrong in your case.

from staticrypt.

AnzuTwo avatar AnzuTwo commented on May 8, 2024

Hi Robin - I am also running into the same issue.

Coincidentally I was trying to debug the same problem only a few minutes before you posted your comment above.
I've just updated and I am still seeing the issue that the user above mentioned.

+ [email protected] updated 1 package and audited 29 packages in 0.36s

staticrypt .\proveYourself.html <MyPasswordHere>
C:\Users\<MyUserName>\AppData\Roaming\npm\node_modules\staticrypt\lib\formater.js:17 .replaceAll(/^.*\brequire\(.*$\n/gm, ""); ^

Thank you for all your help!

from staticrypt.

robinmoisson avatar robinmoisson commented on May 8, 2024

Hi @AnzuTwo - thanks for sharing your details. Interesting to see the problem appears in a simple file structure as well.

Same question, are you calling the command from your project root directory? I don't see the npx in the npx staticrypt command, are you calling the a globally installed staticrypt?

The error you're posting is pretty weird for that version - I've moved the method in 2.3.1, and the line containing .replaceAll(/^.*\brequire\(.*$\n/gm, ""); isn't in formater.js any more (and it should also give a more verbose error message now). Are you sure you are calling the latest version when running the command?

from staticrypt.

AnzuTwo avatar AnzuTwo commented on May 8, 2024

Node version is v12.19.0.

I updated to 2.3.2, tried again, and it worked! I have the encrypted file!

Thanks a lot for the help, this was fun. Very glad I was able to find this thread (:

from staticrypt.

robinmoisson avatar robinmoisson commented on May 8, 2024

Awesome! Thank you both for updating & posting the detail of your errors, this is helping others too.

from staticrypt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.