reveal.js icon indicating copy to clipboard operation
reveal.js copied to clipboard

Full setup fails with npm error

Open hovinen opened this issue 1 year ago • 7 comments

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 [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: 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 [email protected] postinstall node_modules/puppeteer node install.js
1043 info run [email protected] postinstall { code: 0, signal: null }
1044 timing build:run:postinstall:node_modules/core-js Completed in 169ms
1045 info run [email protected] postinstall { code: 0, signal: null }
1046 timing build:run:postinstall:node_modules/es5-ext Completed in 178ms
1047 info run [email protected] 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 [email protected]
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

> [email protected] 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.)

hovinen avatar Apr 09 '24 14:04 hovinen

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 [email protected]: Removed event-stream from gulp-header
npm WARN deprecated [email protected]: 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 avatar Apr 21 '24 09:04 AxelGanter

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

AxelGanter avatar Apr 21 '24 09:04 AxelGanter

I have the same issue. Any progress on this?

frederik-elwert avatar Sep 27 '24 09:09 frederik-elwert

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

hakimel avatar Sep 27 '24 09:09 hakimel

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 [email protected] postinstall node_modules/core-js node -e "try{require('./postinstall')}catch(e){}"
602 info run [email protected] postinstall node_modules/es5-ext  node -e "try{require('./_postinstall')}catch(e){}" || exit 0
603 info run [email protected] postinstall node_modules/puppeteer node install.js
604 info run [email protected] postinstall { code: 0, signal: null }
605 info run [email protected] postinstall { code: 0, signal: null }
606 info run [email protected] 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 [email protected]
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

frederik-elwert avatar Sep 28 '24 19:09 frederik-elwert

Can you pull latest master and give this another go?

I upgraded a few dependencies, including a small bump in node-qunit-puppeteer.

hakimel avatar Oct 11 '24 12:10 hakimel

I tried it again, but unfortunately I still hit the same error.

frederik-elwert avatar Oct 15 '24 13:10 frederik-elwert