-
Notifications
You must be signed in to change notification settings - Fork 258
Open
Description
Describe the bug
Attempting to run an NPM installed package binary results in jsh: spawn email ENOENT
. Initially I used pnpm
to install things. Locally and in CI systems, pnpm will create a node_modules/.bin/email
file that looks like this:
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -z "$NODE_PATH" ]; then
export NODE_PATH="/Users/code/jsx-email/packages/jsx-email/dist/esm/cli/node_modules:/Users/code/jsx-email/packages/jsx-email/dist/esm/node_modules:/Users/code/jsx-email/packages/jsx-email/dist/node_modules:/Users/code/jsx-email/packages/jsx-email/node_modules:/Users/code/jsx-email/packages/node_modules:/Users/code/jsx-email/node_modules:/Users/code/node_modules:/Users/node_modules:/Users/node_modules:/node_modules:/Users/code/jsx-email/node_modules/.pnpm/node_modules"
else
export NODE_PATH="/Users/code/jsx-email/packages/jsx-email/dist/esm/cli/node_modules:/Users/code/jsx-email/packages/jsx-email/dist/esm/node_modules:/Users/code/jsx-email/packages/jsx-email/dist/node_modules:/Users/code/jsx-email/packages/jsx-email/node_modules:/Users/code/jsx-email/packages/node_modules:/Users/code/jsx-email/node_modules:/Users/code/node_modules:/Users/node_modules:/Users/node_modules:/node_modules:/Users/code/jsx-email/node_modules/.pnpm/node_modules:$NODE_PATH"
fi
if [ -x "$basedir/node" ]; then
exec "$basedir/node" --enable-source-maps --no-warnings=ExperimentalWarning "$basedir/../jsx-email/dist/esm/cli/index.mjs" "$@"
else
exec node --enable-source-maps --no-warnings=ExperimentalWarning "$basedir/../jsx-email/dist/esm/cli/index.mjs" "$@"
fi
NPM does it a bit different, but you get the idea.
When I ran ❯ cat node_modules/.bin/email
I was presented with:
#!/usr/bin/env node --enable-source-maps --no-warnings=ExperimentalWarning
import './main.mjs';
Which is significantly not what it should be. It looks like StackBlitz is having a bad day here.
Link to the blitz that caused the error
https://stackblitz.com/edit/jsx-email-repro
Steps to reproduce
npm i
npm run dev
Expected behavior
I'd expect it to run the NPM script, and the appropriate binary. No clue what it's trying to do presently.
Parity with Local
- I have run the project in my local machine and I could not reproduce the issue.
Screenshots
No response
Platform
- OS: [e.g. macOS, Windows, Linux]
- Browser: [e.g. Chrome, Safari, Firefox]
- Version: [e.g. 91.1]
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels