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] Installing dependency with node-gyp-build fails unless foreground-scripts is specified on Raspberry Pi #4374

Closed
2 tasks done
theimpostor opened this issue Feb 4, 2022 · 2 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release

Comments

@theimpostor
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

On Ubuntu focal on raspberry pi, installing bufferutil which has a node-gyp build step fails unless the foreground-scripts option is used.

Expected Behavior

npm install bufferutil should not require foreground-scripts to work.

Steps To Reproduce

  1. In this environment...
$ npm -v
8.4.1
$ node -v
v16.13.2
$ uname -a
Linux pi4u1 5.4.0-1050-raspi #56-Ubuntu SMP PREEMPT Thu Jan 13 13:09:35 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

Using node 16/stable via snapcraft.

  1. With this config...
    prefix = /home/shoda/.npm-global

  2. Run '...'

cd $(mktemp -d)
npm init -y
npm install bufferutil@latest
  1. See error...
npm ERR! code 1
npm ERR! path /tmp/tmp.4dq5qL1pxo/bufferutil-test/node_modules/bufferutil
npm ERR! command failed
npm ERR! command sh -c node-gyp-build

If however run with foreground-scripts it succeeds, see output here: websockets/bufferutil#144 (comment)

Environment

  • npm: 8.4.1
  • Node.js: 16.13.2
  • OS Name: Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-1050-raspi aarch64)
  • System Model Name: Raspberry Pi 4
  • npm config:
; "user" config from /home/shoda/.npmrc

prefix = "/home/shoda/.npm-global" 

; node bin location = /snap/node/5776/bin/node
; cwd = /tmp/tmp.IxT03BDBLm
; HOME = /home/shoda
; Run `npm config ls -l` to show all defaults.
@theimpostor theimpostor added Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release labels Feb 4, 2022
@theimpostor theimpostor changed the title [BUG] <title> [BUG] Installing dependency with node-gyp-build fails unless foreground-scripts is specified on Raspberry Pi Feb 4, 2022
@fritzy
Copy link
Contributor

fritzy commented Feb 16, 2022

I wonder if this is a memory issue. Currently, npm is fairly unbounded when it comes to memory and network usage. You could be running out of RAM. Can you monitor your memory usage and report back?

@theimpostor
Copy link
Author

theimpostor commented Mar 1, 2022

I now believe this is an issue with the node snap package. Using the ubuntu nodesource install of node v16.14.0, npm install bufferutil@latest works just fine without the foreground-scripts option. This is possibly another manifestation of nodejs/snap#13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release
Projects
None yet
Development

No branches or pull requests

2 participants