cldr-data-downloader icon indicating copy to clipboard operation
cldr-data-downloader copied to clipboard

deepEqual throws an error on Node 8, NPM 5

Open thure opened this issue 8 years ago • 21 comments

Installing cldr-data using Node 8 & NPM 5 throws this error:

> [email protected] install <<project dir>>/node_modules/cldr-data
> node install.js

Whops {} deepEqual { url: 
   [ 'https://github.com/unicode-cldr/cldr-core/archive/28.0.2.zip',
     'https://github.com/unicode-cldr/cldr-dates-mo

Where <<project dir>> is the working directory of npm install.

I can't tell why the error is truncated, or if this is just the intended error. Installing with Node v7.5.0 and NPM 4.1.2 works.

thure avatar Jun 02 '17 11:06 thure

Just got same error.

node 8.0.0 npm 5.0.4 OS X

works well when downgraded to node 6.10.3

liesislukas avatar Jul 03 '17 05:07 liesislukas

There are some mentions of deepEqual in the node 8.x changelog, but nothing marked as breaking: https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V8.md

Might be a regression in node 8, or one of those "bug that turned into a feature".

jzaefferer avatar Jul 13 '17 22:07 jzaefferer

Googling for "node 8 deepequal" brings up this issue as the first result.

Probably this isn't related to deepEqual at all.

jzaefferer avatar Jul 13 '17 22:07 jzaefferer

Or is it? Maybe this isn't working anymore: https://github.com/rxaviers/cldr-data-downloader/blob/f60385580b7db9ef8a0a8a137d95e08abccb854e/lib/util.js#L20-L23

jzaefferer avatar Jul 13 '17 22:07 jzaefferer

Well, the util/deepEqual method seems to work fine, I guess the problem is indeed in the data passed into it.

For debugging, should change this line: https://github.com/rxaviers/cldr-data-downloader/blob/285cde6a39a54ea42d87d4f6d410b87ec54bd23f/bin/download.js#L82 - to output error.stack instead of error.message. stack includes the message, AND the stack trace.

jzaefferer avatar Jul 13 '17 22:07 jzaefferer

After trying this again myself (got the error report from someone else today), I was unable to reproduce the error.

$ node --version
v8.1.4
$ npm --version
5.0.3

Does someone else have the issue with these versions? Maybe it got indeed fixed.

jzaefferer avatar Jul 13 '17 22:07 jzaefferer

Though the report I got today was also on node 8.1.4. No idea.

jzaefferer avatar Jul 13 '17 22:07 jzaefferer

Same error here, node v8.1.4 and npm 5.0.3

tonovotny avatar Jul 18 '17 11:07 tonovotny

The error occurs because state.json is missing. This file should be created when installing cldr-data but somehow this is not the case. If it isn't there the default is an empty object {} which leads to the deepEqual failure. Will continue to debug further...

marvinhagemeister avatar Jul 18 '17 14:07 marvinhagemeister

I solved this issue by modifying cldr-data-downloader/lib/util.js this way: https://pastebin.com/3m5Kaqpj I made a delay on running deepEqual by using a setTimeout. I know it's just a trick and not the solution but may help to find it.

mahyard avatar Jul 27 '17 08:07 mahyard

Given the two last comments, i.e., the missing state.json and the use of a timeout to fix the problem, it looks like in npm 8, the post installation is executed prior to the node_modules files creation. Is it? Can someone confirm? If so, it looks like we need to use a different approach, something like this https://github.com/rxaviers/cldr-data-npm/issues/28

rxaviers avatar Jul 27 '17 11:07 rxaviers

Is there any progress on this?

I have same problem.

Node v8.6.0 npm 5.4.2

ozum avatar Oct 03 '17 05:10 ozum

Anyone willing to provide a fix? Guideline in my above comment.

rxaviers avatar Oct 11 '17 21:10 rxaviers

this is blocking node 8 for me :( 🆘

a7madgamal avatar Oct 16 '17 13:10 a7madgamal

I've got this error as well, updating [email protected] package resolved this issue but produced another one.

Received 41238K total.
Unpacking it into `./`
Whops ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/l10ns/node_modules/cldr-data/.gitattributes'

tinganho avatar Oct 21 '17 13:10 tinganho

It seems like adm-zip is not allowed to write to the folder in cldr-data:

Error: EACCES: permission denied, open '/usr/local/lib/node_modules/l10ns/node_modules/cldr-data-test/.gitattributes

tinganho avatar Oct 21 '17 17:10 tinganho

Heads up: A workaround for this problem is to use yarn instead of npm.

rxaviers avatar Nov 26 '17 17:11 rxaviers

So with node 9.2.0, npm install works (npm 5.5.1), but yarn (1.3.2) produces the same deepEqual error

flipchart avatar Dec 01 '17 06:12 flipchart

FYI, I encountered this on version 28 as well, but upgrading to the latest (version 32) of cldr-data worked properly.

node v8.9.4 (npm v5.6.0)

dijonkitchen avatar Jan 18 '18 00:01 dijonkitchen

Heads up: A workaround for this problem is to use yarn instead of npm.

Tried it with yarn, got the same exact error. (node 8.9.0, npm 5.5.1)

hon2a avatar Mar 07 '18 16:03 hon2a

I got the error for version 0.2.x but resolved by upgrading to [email protected]

(node 8.9.0, npm 5.5.1)

Elementenfresser avatar Jun 12 '18 14:06 Elementenfresser