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

Error: Cannot find module '../build/tries/current/icann.complete.json' #35

Closed
MaximeArbisa opened this issue May 31, 2018 · 16 comments
Closed
Assignees

Comments

@MaximeArbisa
Copy link

Hello, everything is working well in local.
But when I try to clone and npm install my project, this error appears for parse-domain, in the line where I require it.

Do you know what may be the problem ?
In node_modules/parse-domain/build/tries when renaming folder pre/ to current/ it works, but what a quick fix ! And why is that folder absent locally ?

Locally:
NPM version: v5.6.0
Node.js version: v8.9.4

Production:
NPM version: v3.8.9
Node.js version: v6.2.0

parse-domain: 2.1.1

Thank you ! :)

@iloughman
Copy link

Having this problem as well.

@unlight
Copy link

unlight commented Jun 11, 2018

You broke my all CI builds
semantic-release/semantic-release#816

@jhnns
Copy link
Member

jhnns commented Jun 11, 2018

These issues arise during postinstall when something goes wrong in this catch block.

Since v2.1.0 we're downloading the most up-to-date list from publicsuffix.org on postinstall (see reasoning behind this change). We try to compile the list and write it into the build folder in our module. If that goes wrong, we try to use a prebuilt list by copying the prebuilt one to the location where the compiled list is expected to be. If something goes wrong here, we can't recover from it.

Do you know why we can't write to the file system in your setup? Is there a better way to do it? Help appreciated ❤️.

@pvdlg
Copy link
Contributor

pvdlg commented Jun 11, 2018

Would it be possible to not write anything in the FS system in the fallback catch?
If the download of the list fails or if it cannot be written in the build directory, would it be possible to use a prebuilt list included in the module without having to copy it?
Maybe you could deliver the package with the prebuilt list in the build directory and try to download the updated list and overwrite the prebuilt one on postinstall. So if it fails the prebuilt list will be used automatically.

@jhnns
Copy link
Member

jhnns commented Jun 13, 2018

Yes, I think that's possible. We could just overwrite the prebuilt list with the up-to-date list. In order to roll back if the unit test fails, we could read the file contents of the prebuilt list into memory before overwriting it with the new version. This way we can always fall back to the prebuilt list. File system access should work at that point because otherwise the updated list could not been overwritten in the first place.

Would you be up to a PR? I think the change shouldn't be too big:

@swyxio
Copy link

swyxio commented Jun 13, 2018

just noting temporary fix: copy node_modules/parse-domain/build/tries/pre to node_modules/parse-domain/build/tries/current

@pvdlg
Copy link
Contributor

pvdlg commented Jun 13, 2018

Unfortunately, I won't have time to make a PR.

@MaximeArbisa
Copy link
Author

Hey guys, I've solved this issue by updating npm:

sudo npm install -g npm

Hope it will solve your problem too !
Cheers

@swyxio
Copy link

swyxio commented Jun 21, 2018

well I was on npm 6.0.0 and had the issue - what did you upgrade from and to @MaximeArbisa ?

@MaximeArbisa
Copy link
Author

@sw-yx, I was v3.8.9, now, I'm v6.1.0.
But locally, I'm v5.6.0, and have never had this problem ...

The problem only occured when I ran my code from development to production, where NPM version was 3.8.9, strange ...

@pvdlg
Copy link
Contributor

pvdlg commented Jun 29, 2018

@jhnns I opened the PR #39 as you suggested. Does the changes works for you?

@bodinsamuel
Copy link

bodinsamuel commented Jul 3, 2018

Hi everyone,
this issue has some huge impact on big projects. Is there any release date ? :)

@pvdlg
Copy link
Contributor

pvdlg commented Jul 3, 2018

@bodinsamuel as you experience this issue, could you try if my fix actually fix it?
Could you try to install the module from https://github.com/pvdlg/parse-domain/tree/overwrite-tries and see if that solve the problem?

npm install pvdlg/parse-domain#overwrite-tries --save

@revmischa
Copy link

I'm seeing this issue on latest parse-domain, building on travis CI

@pvdlg
Copy link
Contributor

pvdlg commented Jul 9, 2018

@jhnns, sorry to bother, but is there a change to get #39 merged? This is impacting a lot of people.

@jhnns jhnns added this to Backlog in Open Source projects Jul 12, 2018
@jhnns jhnns removed this from Backlog in Open Source projects Jul 12, 2018
rufman added a commit to rufman/documentation that referenced this issue Jul 19, 2018
parse-domain issue: peerigon/parse-domain#35 has not been fixed,
but git-url-parse removed that dependency in version 10: IonicaBizau/git-url-parse#80
rufman added a commit to rufman/documentation that referenced this issue Jul 19, 2018
parse-domain issue: peerigon/parse-domain#35 has not been fixed,
but git-url-parse removed that dependency in version 10: IonicaBizau/git-url-parse#80
@jhnns jhnns self-assigned this Jul 23, 2018
@jhnns jhnns added this to Current sprint in Open Source projects Jul 23, 2018
@aiankile
Copy link

Just as a side note: not npm-specific / having same issue irregularly with yarn 1.7.0

@jhnns jhnns closed this as completed in #39 Oct 19, 2018
Open Source projects automation moved this from Current sprint to Done Oct 19, 2018
frux pushed a commit to frux/express-csp-header that referenced this issue Dec 3, 2019
frux pushed a commit to frux/csp that referenced this issue Mar 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

9 participants