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

Doesn't seem to install with npm 3.x #23

Closed
jquense opened this issue Oct 4, 2015 · 9 comments
Closed

Doesn't seem to install with npm 3.x #23

jquense opened this issue Oct 4, 2015 · 9 comments

Comments

@jquense
Copy link

jquense commented Oct 4, 2015

I am not quite sure why but installing cldr-data with npm 3.x always gives an the warning that it is a peer dep and so is not installing. This may be due to the package assuming stuff about node_module layout that isn't true now that its mostly flat.

I did confirm that I had it listed as a dev Dep in my package (and not a peer dep)

@rxaviers
Copy link
Owner

rxaviers commented Oct 5, 2015

Can you give me more details please? I have just npm install cldr-data using [email protected] and it worked just fine.

@rxaviers
Copy link
Owner

rxaviers commented Oct 5, 2015

Also ran npm install on https://github.com/jquery/globalize/tree/1.1.0-rc.3/examples/node-npm without problems.

@jquense
Copy link
Author

jquense commented Oct 5, 2015

yeah sorry for the vague issue, I will look into it more today, I didn't have time yesterday but wanted to make sure I noted it before i forgot!

@jquense
Copy link
Author

jquense commented Oct 14, 2015

Gonna close for now, since I can't repo the issue...I will report back if I can figure it out :)

@jquense jquense closed this as completed Oct 14, 2015
@rxaviers
Copy link
Owner

Thx

@andrei-picus-hs
Copy link

@rxaviers ran into a similar issue. When running npm install --save cldr-data it skips downloading the CLDR data because it doesn't find itself in the dependencies of the project. This is because npm will write the dependency in package.json after the package has been installed.

If I run node node_modules/cldr-data/install.js after the npm command finished then it correctly downloads the CLDR data. Edit: If I run npm install again after the dependency has been written, then it downloads the data. The issue is only when installing the package for the first time inside a project.

May I ask what's the benefit of skipping the download? It seems to come with a lot of highly coupled code (the assumptions about the npm folder hierarchy).

@rxaviers
Copy link
Owner

Before npm@3 we had the following issue: an app having libraries that depend on cldr-data. Therefore, more than one copy were downloaded, which was frustrating... This skip approach helped solving that. On npm@3, dependencies are flattened, so this isn't that useful anymore. I am open to suggestions how to improve this remembering a solution should work for any npm version.

So far I believe #28 would be it.

@andrei-picus-hs
Copy link

an app having libraries that depend on cldr-data

globalize lists it as a peer dependency. How many libraries are out there that actually depend on cldr-data (require() it inside)?

more than one copy were downloaded, which was frustrating

Does removing that frustration outweigh having the frustration of not being able to use cldr-data after installing it for the first time in a project?

Also, what happens when you have 2 libs that depend on 2 versions of cldr-data which would pull different versions of the CLDR bundles (if it's possible)? As it is right now only one bundle would be downloaded, right? Seems to me like multiple copies is the correct outcome. For instance, the PhantomJS npm package will download the binary as many times it needs to in order to fulfill every consumer.

I'm not saying that optimizing the downloads was a bad decision, I'm just asking if it's still valid.

@rxaviers
Copy link
Owner

I'm not sure my explanation was clear. The problem was related to peer dependency only, not direct dependency. It only aborted downloading the files on a special case: two or more libraries having cldr-data as peer dependencies. Globalize depends on cldrjs, both Globalize and cldrjs have cldr-data as peer dependency, which are enough to hit the issue. Again, this isn't an issue anymore on npm@3. Please, just let me know if you have any further questions.

rxaviers pushed a commit that referenced this issue Mar 18, 2016
Fixes #23
Fixes #29
Closes #30

Signed-off-by: Marcel Klehr <[email protected]>
rxaviers added a commit that referenced this issue Mar 18, 2016
rxaviers pushed a commit that referenced this issue Mar 18, 2016
Fixes #23
Fixes #29
Closes #30

Signed-off-by: Marcel Klehr <[email protected]>
rxaviers added a commit that referenced this issue Mar 18, 2016
rxaviers pushed a commit that referenced this issue Mar 18, 2016
Fixes #23
Fixes #29
Closes #30

Signed-off-by: Marcel Klehr <[email protected]>
rxaviers added a commit that referenced this issue Mar 18, 2016
rxaviers pushed a commit that referenced this issue Mar 18, 2016
Fixes #23
Fixes #29
Closes #30

Signed-off-by: Marcel Klehr <[email protected]>
rxaviers added a commit that referenced this issue Mar 18, 2016
rxaviers pushed a commit that referenced this issue Mar 18, 2016
Fixes #23
Fixes #29
Closes #30

Signed-off-by: Marcel Klehr <[email protected]>
rxaviers added a commit that referenced this issue Mar 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants