Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: raineorshine/npm-check-updates
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v16.3.11
Choose a base ref
...
head repository: raineorshine/npm-check-updates
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v16.3.12
Choose a head ref
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on Oct 16, 2022

  1. Copy the full SHA
    609fc72 View commit details
  2. Copy the full SHA
    908b0ef View commit details
  3. 16.3.12

    raineorshine committed Oct 16, 2022
    Copy the full SHA
    ce035eb View commit details
Showing with 11 additions and 8 deletions.
  1. +2 −2 package-lock.json
  2. +1 −1 package.json
  3. +6 −3 src/index.ts
  4. +2 −2 src/package-managers/npm.ts
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "npm-check-updates",
"version": "16.3.11",
"version": "16.3.12",
"author": "Tomas Junnonen <tomas1@gmail.com>",
"license": "Apache-2.0",
"contributors": [
9 changes: 6 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -29,9 +29,12 @@ if (process.env.INJECT_PROMPTS) {
prompts.inject(JSON.parse(process.env.INJECT_PROMPTS))
}

// exit with non-zero error code when there is an unhandled promise rejection
process.on('unhandledRejection', err => {
throw err
// Exit with non-zero error code when there is an unhandled promise rejection.
// Use `node --trace-uncaught ...` to show where the exception was thrown.
// See: https://nodejs.org/api/process.html#event-unhandledrejection
process.on('unhandledRejection', (reason: string | Error) => {
// do not rethrow, as there may be other errors to print out
console.error(reason)
})

/**
4 changes: 2 additions & 2 deletions src/package-managers/npm.ts
Original file line number Diff line number Diff line change
@@ -425,7 +425,7 @@ export async function defaultPrefix(options: Options): Promise<string | undefine

const cmd = process.platform === 'win32' ? 'npm.cmd' : 'npm'

let prefix
let prefix: string | undefined

// catch spawn error which can occur on Windows
// https://github.com/raineorshine/npm-check-updates/issues/703
@@ -444,7 +444,7 @@ export async function defaultPrefix(options: Options): Promise<string | undefine

// FIX: for ncu -g doesn't work on homebrew or windows #146
// https://github.com/raineorshine/npm-check-updates/issues/146
return options.global && prefix.match('Cellar')
return options.global && prefix?.match('Cellar')
? '/usr/local'
: // Workaround: get prefix on windows for global packages
// Only needed when using npm api directly