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

Since v8, npm scripts fail executing #4566

Open
2 tasks done
TimDaub opened this issue Mar 15, 2022 · 5 comments
Open
2 tasks done

Since v8, npm scripts fail executing #4566

TimDaub opened this issue Mar 15, 2022 · 5 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

@TimDaub
Copy link

TimDaub commented Mar 15, 2022

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 dedupe: get deps from shrinkwrap #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

@TimDaub TimDaub 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 Mar 15, 2022
@wraithgar
Copy link
Member

We will need more info to replicate this. Is esbuild a dependency of your package? What does your package.json look like? Have you installed the dependencies? With what command?

@TimDaub
Copy link
Author

TimDaub commented Mar 15, 2022

esbuild is locally installed and accessible via npm scripts. which esbuild yields nothing as it wasn't installed globally. I did the two commands one after each other after downgrading npm to v6.

@wraithgar
Copy link
Member

We need a way to replicate this locally. If I install esbuild into a package w/ npm@6 and then use npm@8 to run it it works fine.

~/D/n/s/esb $ npx npm@6 install esbuild
~/D/n/s/esb $ npm pkg get scripts.foo
"esbuild"
~/D/n/s/esb $ npm run foo

> esb@1.0.0 foo
> esbuild


Usage:
  esbuild [options] [entry points]

@nlf
Copy link
Contributor

nlf commented Mar 15, 2022

the permission denied portion of the error makes it look like the esbuild bin script isn't executable. you can try removing your node_modules and re-running npm i to see if npm will fix it for you, or chmod +x node_modules/.bin/esbuild to manually fix it yourself

@TimDaub
Copy link
Author

TimDaub commented Mar 16, 2022

[ -x ./node_modules/.bin/esbuild ] && echo "File is executable" || echo "File isn't"
File is executable

according to this SE post

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

3 participants