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

Can't install #109

Open
otatar opened this issue Sep 8, 2020 · 2 comments
Open

Can't install #109

otatar opened this issue Sep 8, 2020 · 2 comments

Comments

@otatar
Copy link

otatar commented Sep 8, 2020

Cant't build:

ReferenceError: primordials is not defined at fs.js:35:5

Node version: v12.16.1
Gulp: CLI version: 2.3.0
Local version: 3.9.1

@amotl
Copy link

amotl commented Nov 12, 2020

Hi there,

@Chrisputer probably mentioned the same issue at grafana-toolbox/panodata-map-panel#82:

I cannot get this to build at all.

https://stackoverflow.com/questions/55921442/how-to-fix-referenceerror-primordials-is-not-defined-in-node tells us everything about the background why this is happening with newer releases of Node.js like

$ node --version
v14.15.0

Origin of the problem

This issue stems from the fact that [email protected] depends on graceful-fs@^3.0.0 which monkeypatches Node.js fs module.

This used to work with Node.js until version 11.15 (which is a version from a development branch and shouldn't be used in production).

graceful-fs@^4.0.0 does not monkeypatch Node.js fs module anymore, which makes it compatible with Node.js > 11.15 (tested and working with versions 12 and 14).

Note that this is not a perennial solution but it helps when you don't have the time to update to gulp@^4.0.0.

So, just add this to the package.json file

  "resolutions": {
    "graceful-fs": "^4.2.4"
  }

and invoke

npx yarn install
npx yarn build

Voila:

yarn run v1.22.10
$ gulp
[23:20:30] Using gulpfile ~/dev/foss/globalnoc-networkmap-panel/gulpfile.js
[23:20:30] Starting 'default'...
[23:20:30] Finished 'default' after 34 ms
[23:20:30] gulp-debug: src/CustomHover.js
[23:20:30] gulp-debug: src/atlas3.js
[23:20:30] gulp-debug: src/module.js
[dialog.css]..................built in 667ms
[23:20:30] gulp-debug: src/scale.js
[23:20:30] gulp-debug: 4 items
[leafletmap.css]..............built in 786ms
[datasource.js]...............built in 2119ms
[legend.js]...................built in 2276ms
[leafletmap.js]...............built in 2682ms
✨  Done in 4.48s.

With kind regards,
Andreas.

@amotl
Copy link

amotl commented Nov 14, 2020

#117 is a pull request which includes this small update outlined above.

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

2 participants