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.2
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.3
Choose a head ref
  • 3 commits
  • 4 files changed
  • 2 contributors

Commits on Sep 27, 2022

  1. Fix module usage docs (#1195)

    qmhc authored Sep 27, 2022
    Copy the full SHA
    21a9e29 View commit details

Commits on Sep 28, 2022

  1. Copy the full SHA
    361dfe5 View commit details
  2. 16.3.3

    raineorshine committed Sep 28, 2022
    Copy the full SHA
    373441e View commit details
Showing with 32 additions and 6 deletions.
  1. +1 −1 README.md
  2. +2 −2 package-lock.json
  3. +1 −1 package.json
  4. +28 −2 src/index.ts
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -324,7 +324,7 @@ npm-check-updates can be imported as a module:
```js
import ncu from 'npm-check-updates'
const upgraded = await ncu.run({
const upgraded = await ncu({
// Pass any cli option
packageFile: '../package.json',
upgrade: true,
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.2",
"version": "16.3.3",
"author": "Tomas Junnonen <tomas1@gmail.com>",
"license": "Apache-2.0",
"contributors": [
30 changes: 28 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -112,8 +112,34 @@ const npmInstall = async (
const packageManager = await getPackageManagerForInstall(options, pkgFile)
const cmd = packageManager + (process.platform === 'win32' ? '.cmd' : '')
const cwd = options.cwd || path.resolve(pkgFile, '..')
const stdout = await spawn(cmd, ['install'], { cwd })
print(options, stdout, 'verbose')
let stdout = ''
try {
await spawn(cmd, ['install'], {
cwd,
...(packageManager === 'pnpm'
? {
env: {
...process.env,
// With spawn, pnpm install will fail with ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies.
// When pnpm install is run directly from the terminal, this error does not occur.
// When pnpm install is run from a simple spawn script, this error does not occur.
// The issue only seems to be when pnpm install is executed from npm-check-updates, but it's not clear what configuration or environmental factors are causing this.
// For now, turn off strict-peer-dependencies on pnpm autoinstall.
// See: https://github.com/raineorshine/npm-check-updates/issues/1191
npm_config_strict_peer_dependencies: false,
},
}
: null),
stdout: (data: string) => {
stdout += data
},
})
print(options, stdout, 'verbose')
} catch (err: any) {
// sometimes packages print errors to stdout instead of stderr
// if there is nothing on stderr, reject with stdout
throw new Error(err?.message || err || stdout)
}
})
}
}