hakimel / reveal.js

The HTML Presentation Framework
https://revealjs.com
MIT License
67.65k stars 16.64k forks source link

Full setup fails with npm error #3608

Open hovinen opened 5 months ago

hovinen commented 5 months ago

Seems to be related to puppeteer. This is on a fresh checkout from GitHub as of the time of writing (9 April 2024).

OS: Ubuntu 23.10

➜ node --version
v20.12.1
➜ npm --version
10.5.1

Output:

➜ npm install
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm ERR! code 1
npm ERR! path <redacted>/node_modules/puppeteer
npm ERR! command failed
npm ERR! command sh -c node install.js

npm ERR! A complete log of this run can be found in: <redacted>/.npm/_logs/2024-04-09T13_59_39_973Z-debug-0.log

Log file:

1042 info run puppeteer@19.11.1 postinstall node_modules/puppeteer node install.js
1043 info run core-js@3.33.1 postinstall { code: 0, signal: null }
1044 timing build:run:postinstall:node_modules/core-js Completed in 169ms
1045 info run es5-ext@0.10.62 postinstall { code: 0, signal: null }
1046 timing build:run:postinstall:node_modules/es5-ext Completed in 178ms
1047 info run puppeteer@19.11.1 postinstall { code: 1, signal: null }
1048 timing reify:rollback:createSparse Completed in 711ms
1049 timing reify:rollback:retireShallow Completed in 0ms
1050 timing command:install Completed in 18137ms
1051 verbose stack Error: command failed
1051 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27)
1051 verbose stack     at ChildProcess.emit (node:events:518:28)
1051 verbose stack     at maybeClose (node:internal/child_process:1105:16)
1051 verbose stack     at ChildProcess._handle.onexit (node:internal/child_process:305:5)
1052 verbose pkgid puppeteer@19.11.1
1053 verbose cwd <redacted>
1054 verbose Linux 6.5.0-9-generic
1055 verbose node v20.12.1
1056 verbose npm  v10.5.1
1057 error code 1
1058 error path <redacted>/node_modules/puppeteer
1059 error command failed
1060 error command sh -c node install.js
1061 verbose exit 1

Since puppeteer is a dev dependency, I tried omitting that with --omit dev. Then npm install runs but npm start does not:

➜ npm start

> reveal.js@5.0.5 start
> gulp serve

sh: 1: gulp: not found

So I'm stuck. Any help would be appreciated. Thanks!

(P.S. Please note that I can't globally downgrade node due to other obligations. But also, since the documentation doesn't give a maximum version of node with which reveal.js is compatible, I wouldn't know to which version to downgrade.)

AxelGanter commented 5 months ago

I also have problems installing I guess @hovinen s problem with puppeteer is also related to the deprecated gulp-util

:~/development/reveal.js$ npm audit fix --force
npm WARN using --force Recommended protections disabled.
npm WARN audit Updating gulp-header to 1.8.9,which is a SemVer major change.
npm WARN deprecated gulp-header@1.8.9: Removed event-stream from gulp-header
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5

added 37 packages, changed 3 packages, and audited 924 packages in 5s

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

# npm audit report

lodash.template  *
Severity: high
Command Injection in lodash - https://github.com/advisories/GHSA-35jh-r3h4-6jhm
fix available via `npm audit fix`
node_modules/lodash.template
  gulp-util  >=1.1.0
  Depends on vulnerable versions of lodash.template
  node_modules/gulp-util

2 high severity vulnerabilities
AxelGanter commented 5 months ago

https://github.com/orgs/gulpjs/discussions/2633 seems like one should not use gulp anymore :-S what do others think about that?

frederik-elwert commented 2 days ago

I have the same issue. Any progress on this?

hakimel commented 2 days ago

Looks like gulp 5 is out now, maybe an upgrade will help with these install issues.

frederik-elwert commented 1 day ago

I don’t think gulp is really the issue here, it’s puppeteer.

I removed "node-qunit-puppeteer" from package.json, and then I could run npm install without issues. Then I just had to comment out/remove the line const qunit = require('node-qunit-puppeteer') from gulpfile.js so I could run any commands. (I think just testing requires puppeteer, so building works fine.)

Here’s the relevant part of the npm log that shows that somehow the culprit seems to be puppeteer’s postinst command:

601 info run core-js@3.33.1 postinstall node_modules/core-js node -e "try{require('./postinstall')}catch(e){}"
602 info run es5-ext@0.10.62 postinstall node_modules/es5-ext  node -e "try{require('./_postinstall')}catch(e){}" || exit 0
603 info run puppeteer@19.11.1 postinstall node_modules/puppeteer node install.js
604 info run es5-ext@0.10.62 postinstall { code: 0, signal: null }
605 info run core-js@3.33.1 postinstall { code: 0, signal: null }
606 info run puppeteer@19.11.1 postinstall { code: 1, signal: null }
607 verbose stack Error: command failed
607 verbose stack     at ChildProcess.<anonymous> (/snap/node/8863/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27)
607 verbose stack     at ChildProcess.emit (node:events:517:28)
607 verbose stack     at maybeClose (node:internal/child_process:1098:16)
607 verbose stack     at ChildProcess._handle.onexit (node:internal/child_process:303:5)
608 verbose pkgid puppeteer@19.11.1
609 verbose cwd <redacted>/reveal.js
610 verbose Linux 6.5.0-1027-oem
611 verbose node v18.20.4
612 verbose npm  v10.7.0
613 error code 1
614 error path <redacted>/reveal.js/node_modules/puppeteer
615 error command failed
616 error command sh -c node install.js
617 verbose exit 1
618 verbose code 1