Comments (6)
Hi, thanks for reporting.
I'd like to better understand your use case, and then see what makes sense for npm-check-updates to support.
Why does husky install hooks
fail? It seems like if a project has a prepare script, it should be expected to pass. npm prepare
is automatically run after npm install
, so a failed prepare script would presumably crash your normal install anyway.
from npm-check-updates.
Here's a repo that reproduces the issue: https://github.com/adamhl8/ncu-1362
I'm running ncu -d -u --doctorTest 'yarn test'
The prepare script works fine normally. It only fails when executed under ncu. I haven't been able to figure out why.
from npm-check-updates.
Thanks. On my machine (OSX), the test script in the repo you provided is failing rather than the prepare script. It fails on the sed command (even without running ncu).
So I'm not sure if that properly reproduces your original issue.
raine[ncu-1362]% npm test
> [email protected] test
> vitest run && sed -i 's|expect(true)|expect(true).toBeFalsy()|' ./src/__tests__/index.test.tsx
RUN v0.29.8 /Users/raine/projects/ncu-1362
✓ src/__tests__/index.test.tsx (1)
Test Files 1 passed (1)
Tests 1 passed (1)
Start at 19:33:46
Duration 688ms (transform 45ms, setup 0ms, collect 23ms, tests 3ms)
sed: 1: "./src/__tests__/index.t ...": invalid command code .
raine[ncu-1362]% echo $?
1
from npm-check-updates.
Sorry, I should have specified. That sed command has nothing to do with the issue itself and is not in the actual project I'm having this issue with. It's there because I need the test to pass initially so ncu --doctor
continues and tries to update the dependencies. That sed command makes it so after that initial run the test fails so ncu will try to upgrade each dependency individually.
I'm on macOS as well. Are you using gnu-sed? The default, older version that ships with macOS might not support that syntax or something.
Edit: I changed the sed command in the repo to work with the default macOS sed.
from npm-check-updates.
Thanks! I was able to successfully reproduce it.
Internally, the options --depth=0
and --json
are added to package manager commands such as npm list
to ensure that the output can be parsed correctly. They are added to all package manager commands, which is usually harmless, however it turns out that yarn test --depth=0 --json
behaves differently than npm test --depth=0 --json
. yarn passes the option through to the test script, which causes sed to choke on --depth=0
. Changing the order to yarn --depth=0 --json test
fixes the issue.
I have published a fix to v16.14.13
. Let me know if that helps.
from npm-check-updates.
That fixed it. Thank you!
from npm-check-updates.
Related Issues (20)
- Feature: Update GitHub Actions HOT 1
- Interactive mode reprints everything on keydown HOT 9
- CERT_HAS_EXPIRED when running ncu HOT 2
- bunfig.toml is not considered when using bun HOT 2
- Broken `ncu -g` with Error since v16.14.13 HOT 9
- [FR] ncu -u -E/--save-exact HOT 1
- Node v21: rimraf module not found HOT 5
- Recent upgrade breaks ncu on mac HOT 3
- [Feature] Exclude dependency from being considered for --peer checking HOT 7
- ERR_SOCKET_TIMEOUT on node v18 HOT 17
- error: cannot find rimraf HOT 2
- NCU does not complain about a `configFileName` that does not exist HOT 1
- --peer not respected for versions with ^ or ~ HOT 2
- Make --format group,repo the default HOT 3
- Unable to upgrade packages which are circular peer dependencies HOT 14
- [Feature] Allow fully resolved custom/non-repo urls to display with --format repo HOT 1
- Suggestion: Add `packageManager` to the default value of `--dep` HOT 1
- How to update `package.json` with versions already installed in `package-lock.json`? HOT 2
- backup old package json HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from npm-check-updates.