negomi / react-burger-menu

:hamburger: An off-canvas sidebar component with a collection of effects and styles using CSS transitions and SVG path animations
http://negomi.github.io/react-burger-menu/
MIT License
5.04k stars 582 forks source link

Error installing #384

Closed juanda99 closed 4 years ago

juanda99 commented 4 years ago

These are my steps and the error:

➜  react-burger-menu git:(master) ✗ node -v
v12.16.2

➜  react-burger-menu git:(master) ✗ npm i
audited 1642 packages in 5.135s

3 packages are looking for funding
  run `npm fund` for details

found 521 vulnerabilities (224 low, 10 moderate, 285 high, 2 critical)
  run `npm audit fix` to fix them, or `npm audit` for details

➜  react-burger-menu git:(master) ✗ npm start

> react-burger-menu@2.6.15 start /Users/juandaniel/Code/react-burger-menu
> gulp dev

fs.js:35
} = primordials;
    ^

ReferenceError: primordials is not defined
    at fs.js:35:5
    at req_ (/Users/juandaniel/Code/react-burger-menu/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/Users/juandaniel/Code/react-burger-menu/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/Users/juandaniel/Code/react-burger-menu/node_modules/vinyl-fs/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:1156:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Module.require (internal/modules/cjs/loader.js:1042:19)
    at require (internal/modules/cjs/helpers.js:77:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-burger-menu@2.6.15 start: `gulp dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-burger-menu@2.6.15 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/juandaniel/.npm/_logs/2020-06-09T13_44_45_135Z-debug.log
juanda99 commented 4 years ago

I think it's related to https://github.com/gulpjs/gulp/issues/2324. Upgrading gulp to 4.x throws error so I decided to downgrading node to v10 fixes the issue.

negomi commented 4 years ago

Hey @juanda99, yeah, it only works with Node 10 right now. Glad you figured it out :)

MattFisher commented 4 years ago

@negomi Gulp is in devDependencies, so I'm not sure you should be restricting the node engine for this.

We use react-burger-menu in a webpack-based build with node 12, and it works fine with v2.6.15, but v2.6.16 no longer installs due to the node engine restriction from https://github.com/negomi/react-burger-menu/commit/f8c7faeef300c71c3c42b5b9a478093857e3a1b4

negomi commented 4 years ago

Oh that's a good point, I'll just switch to mentioning the Node 10 in the README.

Just released 2.6.17 with the fix.

Sorry about that!