Git Product home page Git Product logo

Comments (16)

jamesthompson avatar jamesthompson commented on July 1, 2024

@AladdiX I saw this same behavior... It turned out it was a typo for me, I had Latest rather than latest. This at least fixed it for me. I'm brand new to the program, so I'm not sure that's going to help in your case... but it has to be worth a shot...

from npm2nix.

bobvanderlinden avatar bobvanderlinden commented on July 1, 2024

I have the same problem with the package.json from popcorntime.

This is with npm2nix 5.12.0 from nixpkgs.

from npm2nix.

offlinehacker avatar offlinehacker commented on July 1, 2024

Yes, thats probably because of the changes in npm format, which now supports something like github:owner/repo and similar ways to specifiy git/github repos. I will have to fix npm2nix soon, because we also depend on it. And yeah, everytime npm2nix fails, it generates only header, so there is some other error, besides the empty file.

Too bad i have to fix it every few months(but it's the only thing we have and code is a bit of mess, and yeah coffescript), we will have to figure out simpler and more solid solution for new npm2nix, any ideas?

from npm2nix.

bobvanderlinden avatar bobvanderlinden commented on July 1, 2024

Hmm, one problem I found was that optjs has a version that is incompatible with the latest semver (3.2.1-boom, notice the -boom. 3.2.1-boom doesn't satisfy the * spec), sigh. The semver version used by the stable npm version works alright, the version used by npm2nix at the moment does not. Should I do a PR to downgrade semver to the right version (~4.2.0 vs ~4.3.0)?

The generated nix file is still not complete though, I'll investigate further.

I see how you'd have to fix things every few months. This really is quite annoying. If npm had some kind of library that handles most of what you're doing in npm2nix, that might be better. Though, from what I've found they don't.

from npm2nix.

offlinehacker avatar offlinehacker commented on July 1, 2024

Yeah, i think it should be save to downgrade semver if it fixes the
problem. We still need to find better solution for npm2nix. Is there any
nice way we could get dependencies after doing "npm install"?

On Sun, Jun 7, 2015 at 9:20 PM Bob van der Linden [email protected]
wrote:

Hmm, one problem I found was that optjs has a version that is
incompatible with the latest semver (3.2.1-boom, notice the -boom.
3.2.1-boom doesn't satisfy the * spec), sigh. The semver version used by
the stable npm version works alright, the version used by npm2nix at the
moment does not. Should I do a PR to downgrade semver to the right version (
~4.2.0 vs ~4.3.0)?

The generated nix file is still not complete though, I'll investigate
further.

I see how you'd have to fix things every few months. This really is quite
annoying. If npm had some kind of library that handles most of what you're
doing in npm2nix, that might be better. Though, from what I've found they
don't.


Reply to this email directly or view it on GitHub
#21 (comment).

from npm2nix.

bobvanderlinden avatar bobvanderlinden commented on July 1, 2024

I've submitted #24, which solved the problem of a incomplete output for me. It should also give a better indication why the file isn't complete yet (if this is still a problem), because one of the packages is stuck fetching the necessairy data. With the PR it'll show which packages still seem to be fetching at that time.

from npm2nix.

bobvanderlinden avatar bobvanderlinden commented on July 1, 2024

@offlinehacker npm ls shows all installed dependencies in node_modules, each with their version number. This could be of use. Not sure if parsing npm ls is the right way or whether we could use npm's code to get the same information in a better format.

from npm2nix.

offlinehacker avatar offlinehacker commented on July 1, 2024

It might be sane to add a feature to "npm ls" to output json, this solves a
part of the problem, the other part is fetching dependencies, but this is
clearly more simple problem. I will check if there are any other issues
with taking this approach and write a tool.

On Sun, Jun 7, 2015 at 11:35 PM Bob van der Linden [email protected]
wrote:

@offlinehacker https://github.com/offlinehacker npm ls shows all
installed dependencies in node_modules, each with their version number.
This could be of use. Not sure if parsing npm ls is the right way or
whether we could use npm's code to get the same information in a better
format.


Reply to this email directly or view it on GitHub
#21 (comment).

from npm2nix.

bobvanderlinden avatar bobvanderlinden commented on July 1, 2024

"npm ls" outputs all packages in a recursive tree. You do see the dependencies that way.

What is still missing is the hashes for the targz files. It would be nice if npm could download only the targz files, so that npm2nix can hash them. Not sure what a good approach would be for this though. Maybe those files are available in some cache?

EDIT: Having it in JSON would be a nice approach I think.
Found it: npm ls --json

from npm2nix.

offlinehacker avatar offlinehacker commented on July 1, 2024

And hashes for git repos i guess too...

On Sun, Jun 7, 2015 at 11:47 PM Bob van der Linden [email protected]
wrote:

"npm ls" outputs all packages in a recursive tree. You do see the
dependencies that way.

What is still missing is the hashes for the targz files. It would be nice
if npm could download only the targz files, so that npm2nix can hash them.
Not sure what a good approach would be for this though. Maybe those files
are available in some cache?


Reply to this email directly or view it on GitHub
#21 (comment).

from npm2nix.

bobvanderlinden avatar bobvanderlinden commented on July 1, 2024

Oh right, I forgot about those. Since git repos as dependencies aren't the norm it doesn't matter much to retrieve them seperately.

As for targz files: here is the cache: ~/.npm/log-symbols/1.0.2/package.tgz

from npm2nix.

bobvanderlinden avatar bobvanderlinden commented on July 1, 2024

I've created #25 so that we can focus on reusing npm there. I hope this issue is solved with #24.

from npm2nix.

wmertens avatar wmertens commented on July 1, 2024

I'm really looking forward to #25, sounds like the right way to do things! In the mean time, is there a way to get the error from npm2nix so we know where to dig?

from npm2nix.

lucabrunox avatar lucabrunox commented on July 1, 2024

Any news? Nodejs is rather unusable without npm2nix. The latest nixos unstable as of NixOS/nixpkgs@1357692 still has this issue.

from npm2nix.

offlinehacker avatar offlinehacker commented on July 1, 2024

We have to make a new implementation, current one is broken by design and
by code. I will not have time before next weekend, but i need this too, so
i will make an attempt then if noone else will do it before.

On Thu, Aug 20, 2015 at 9:31 PM lethalman [email protected] wrote:

Any news? Node packages are rather unusable without npm2nix. The latest
nixos unstable as of 1357692 still has this issue.


Reply to this email directly or view it on GitHub
#21 (comment).

from npm2nix.

bobvanderlinden avatar bobvanderlinden commented on July 1, 2024

@offlinehacker What about the shrinkwrap idea? Is that a viable solution or is it something to avoid?

from npm2nix.

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.