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

[Bug]: command failed: command sh -c node install.mjs #11553

Closed
2 tasks
MatthijsBurgh opened this issue Dec 14, 2023 · 6 comments
Closed
2 tasks

[Bug]: command failed: command sh -c node install.mjs #11553

MatthijsBurgh opened this issue Dec 14, 2023 · 6 comments

Comments

@MatthijsBurgh
Copy link

MatthijsBurgh commented Dec 14, 2023

Minimal, reproducible example

{
  "name": "test",
  "description": "None",
  "version": "0.0.1",
  "devDependencies": {  # or "dependencies"
    "puppeteer": "^21.0.1"
  },
  "engines": {
    "node": ">=0.10"
  }
}

Error string

command failed: command sh -c node install.mjs

Bug behavior

  • Flaky
  • PDF

Background

npm install and npm ci don't work

Expectation

Puppeteer should install fine.

Reality

npm info run puppeteer@21.6.1 postinstall node_modules/puppeteer node install.mjs
npm info run puppeteer@21.6.1 postinstall { code: 1, signal: null }
npm verb stack Error: command failed
npm verb stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27)
npm verb stack     at ChildProcess.emit (node:events:517:28)
npm verb stack     at maybeClose (node:internal/child_process:1098:16)
npm verb stack     at ChildProcess._handle.onexit (node:internal/child_process:303:5)
npm verb pkgid puppeteer@21.6.1
npm verb cwd /home/matthijs/src/roslibjs
npm verb Linux 6.2.0-37-generic
npm verb node v18.18.0
npm verb npm  v10.2.4
npm ERR! code 1
npm ERR! path /home/matthijs/src/roslibjs/node_modules/puppeteer
npm ERR! command failed
npm ERR! command sh -c node install.mjs
npm verb exit 1

Puppeteer configuration file (if used)

No response

Puppeteer version

21.6.1

Node version

18.18.0

Package manager

npm

Package manager version

10.2.4

Operating system

Linux

Copy link

github-actions bot commented Dec 14, 2023

This issue was not reproducible. Please check that your example runs locally and the following:

  • Ensure the script does not rely on dependencies outside of puppeteer and puppeteer-core.
  • Ensure the error string is just the error message.
    • Bad:

      Error: something went wrong
        at Object.<anonymous> (/Users/username/repository/script.js:2:1)
        at Module._compile (node:internal/modules/cjs/loader:1159:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
        at Module.load (node:internal/modules/cjs/loader:1037:32)
        at Module._load (node:internal/modules/cjs/loader:878:12)
        at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
        at node:internal/main/run_main_module:23:47
    • Good: Error: something went wrong.

  • Ensure your configuration file (if applicable) is valid.
  • If the issue is flaky (does not reproduce all the time), make sure 'Flaky' is checked.
  • If the issue is not expected to error, make sure to write 'no error'.

Once the above checks are satisfied, please edit your issue with the changes and we will
try to reproduce the bug again.


Analyzer run

@jrandolf
Copy link
Contributor

jrandolf commented Dec 14, 2023

I'm not sure what the bug is here. What are you attempting to do? Install Puppeteer?

Our CI shows that installing puppeteer is fine. From your issue, I'm afraid we cannot deduce the problem. It seems to be related to how your environment is set up.

@jrandolf jrandolf closed this as not planned Won't fix, can't repro, duplicate, stale Dec 14, 2023
@MatthijsBurgh
Copy link
Author

I have tested in a clean docker, with the installation according to the node.js website. This works.

Previously I was using the node installation via snap. That might be the issue, as when I use the node.js installation on my machine it also works.

So leaving this message for future references.

@bltr
Copy link

bltr commented Feb 19, 2024

The error can be reproduced if node is installed via snap.

@jaller94
Copy link

+1 for this being an issue when Node is installed via Snap on Ubuntu.

@salim-b
Copy link

salim-b commented Feb 28, 2024

I can reproduce this issue on Ubuntu 22.04 with Node.js installed via Snap (with both v20.11.1 and v21.6.2).

While searching for a solution, I stumbled upon a similar issue in esbuild that was found to be related to stderr not being writable in the Snap version of Node.js. It was fixed by simply prepending stdio: 'pipe' to a execFileSync call. Hope it helps to narrow down the root cause.

Related issue report: nodejs/snap#25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants