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

Many npm scripts broken after upgrading to latest fnm #1170

Closed
paambaati opened this issue Jun 10, 2024 · 2 comments
Closed

Many npm scripts broken after upgrading to latest fnm #1170

paambaati opened this issue Jun 10, 2024 · 2 comments

Comments

@paambaati
Copy link

Using fnm 1.37.0, some of my pnpm / npm scripts are broken.

When running tests (from paambaati/codeclimate-action#753), I see this error locally –

$ pnpm run test

> [email protected] test /my-project
> cross-env NODE_OPTIONS="--no-warnings" tap run --disable-coverage

/bin/sh: /Users/me/Library/Application: No such file or directory
tap build failed { code: 127, signal: null }
/my-project/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected]__react@1_uxqn7q3ujtffkj7pjef7czkx3u/node_modules/@tapjs/run/src/build.ts:32
          Object.assign(new Error('build failed'), {
                        ^


Error: build failed
    at <anonymous> (/my-project/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected]__react@1_uxqn7q3ujtffkj7pjef7czkx3u/node_modules/@tapjs/run/src/build.ts:32:25)
    at ChildProcess.<anonymous> (/my-project/node_modules/.pnpm/[email protected]/node_modules/foreground-child/src/index.ts:163:20)
    at ChildProcess.emit (node:events:520:28)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
  code: 1,
  signal: null
}

Node.js v22.2.0
 ELIFECYCLE  Test failed. See above for more details.

The detailed npm log is here –

verbose cli /Users/me/Library/Application Support/fnm/node-versions/v22.2.0/installation/bin/node /Users/me/Library/Caches/fnm_multishells/40942_1716553967514/bin/npm
1 info using [email protected]
2 info using [email protected]
3 silly config:load:file:/Users/me/Library/Application Support/fnm/node-versions/v22.2.0/installation/lib/node_modules/npm/npmrc
4 silly config:load:file:/Users/me/my-project/.npmrc
5 silly config:load:file:/Users/me/.npmrc
6 silly config:load:file:/Users/me/Library/Application Support/fnm/node-versions/v22.2.0/installation/etc/npmrc
7 verbose title npm ls tap
8 verbose argv "ls" "tap"
9 verbose logfile logs-max:10 dir:/Users/me/.npm/_logs/2024-06-10T13_36_44_570Z-
10 verbose logfile /Users/me/.npm/_logs/2024-06-10T13_36_44_570Z-debug-0.log
11 silly logfile start cleaning logs, removing 1 files
12 silly logfile done cleaning log files
13 verbose stack Error: invalid: [email protected] /Users/me/my-project/node_modules/tap
13 verbose stack     at LS.exec (/Users/me/Library/Application Support/fnm/node-versions/v22.2.0/installation/lib/node_modules/npm/lib/commands/ls.js:203:9)
13 verbose stack     at async module.exports (/Users/me/Library/Application Support/fnm/node-versions/v22.2.0/installation/lib/node_modules/npm/lib/cli/entry.js:74:5)
14 verbose cwd /Users/me/my-project
15 verbose Darwin 23.5.0
16 verbose node v22.2.0
17 verbose npm  v10.7.0
18 error code ELSPROBLEMS
19 error invalid: [email protected] /Users/me/my-project/node_modules/tap
20 verbose exit 1
21 verbose code 1
22 error A complete log of this run can be found in: /Users/me/.npm/_logs/2024-06-10T13_36_44_570Z-debug-0.log

Interestingly, I do not see this error in CI (GHA) – see https://github.com/paambaati/codeclimate-action/actions/runs/9396406706/job/25877524235?pr=753

Some observations –

  1. The node path seems to resolve to /Users/me/Library/Application Support/fnm, but the shell cannot use that path as the space in "Application Support" is not escaped.
  2. Because this works fine in CI, I'm inclined to believe this has to do something with fnm.
@paambaati
Copy link
Author

Related – tapjs/tapjs#1030

@Schniz
Copy link
Owner

Schniz commented Jun 10, 2024

sounds like paths are not escaped in tapjs, the /Application Support/ path is here for a bunch of versions already, and I can't say I like it to be honest, but it's not new.

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

No branches or pull requests

2 participants