npm / npm/cli

Since v8, npm scripts fail executing

Open
#4,566 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Needs Triage Release 8.x
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

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
root@strike:~/strike# npm run build:frontend

> strike@0.0.1 build:frontend
> esbuild ./client/src/VotingApp.mjs --minify --bundle --format=esm --outfile=./src/public/bundle.js

sh: 1: esbuild: Permission denied
root@strike:~/strike# npm --version
8.5.4
Expected Behavior
root@strike:~/strike# npm run build:frontend

> strike@0.0.1 build:frontend /root/strike
> esbuild ./client/src/VotingApp.mjs --minify --bundle --format=esm --outfile=./src/public/bundle.js


  src/public/bundle.js  73.4kb

⚡ Done in 57ms
root@strike:~/strike# npm -v
6.14.16
Steps To Reproduce

No response

Environment
  • npm: 8.5.4
  • Node.js: v14.18.1
  • OS Name: Linux strike 5.4.0-104-generic #118-Ubuntu SMP Wed Mar 2 19:02:41 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
  • System Model Name: ubuntu
  • npm config:
npm config ls
; cli configs
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.14.16 node/v14.18.1 linux x64"

; node bin location = /usr/bin/node
; cwd = /root/strike
; HOME = /root
; "npm config ls -l" to show all defaults.

workaround

downgrading npm@6 fixes the problem

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce npm run build:frontend with npm 8.5.4 and compare it with npm 6.14.16, using the reported esbuild command and environment details as the starting point. Investigate why the command receives Permission denied; done means the script completes and produces src/public/bundle.js without requiring the npm downgrade workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
build-system, cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.