npm-check-updates 11.8.3 → 11.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,10 +19,18 @@ You may also want to consider [npm-check](https://github.com/dylang/npm-check).
19
19
 
20
20
  ## Installation
21
21
 
22
+ Install globally:
23
+
22
24
  ```sh
23
25
  npm install -g npm-check-updates
24
26
  ```
25
27
 
28
+ Or run with [npx](https://docs.npmjs.com/cli/v7/commands/npx):
29
+
30
+ ```sh
31
+ npx npm-check-updates
32
+ ```
33
+
26
34
  ## Usage
27
35
 
28
36
  Show any new dependencies for the project in the current directory:
@@ -288,6 +296,7 @@ const ncu = require('npm-check-updates')
288
296
 
289
297
  ## Known Issues
290
298
 
299
+ - If `ncu` prints output that does not seem related to this package, it may be conflicting with another executable such as `ncu-weather-cli` or Nvidia CUDA. Try using the long name instead: `npm-check-updates`.
291
300
  - Windows: If npm-check-updates hangs, try setting the package file explicitly: `ncu --packageFile package.json`. You can run `ncu --loglevel verbose` to confirm that it was incorrectly waiting for stdin. See [#136](https://github.com/raineorshine/npm-check-updates/issues/136#issuecomment-155721102).
292
301
 
293
302
  ## Problems?
package/lib/index.js CHANGED
@@ -122,6 +122,9 @@ async function analyzeGlobalPackages(options) {
122
122
 
123
123
  async function analyzeProjectDependencies(options, pkgData, pkgFile) {
124
124
 
125
+ print(options, '\nOptions:', 'verbose')
126
+ print(options, sortOptions(options), 'verbose')
127
+
125
128
  let pkg
126
129
 
127
130
  if (options.color) {
@@ -142,15 +145,15 @@ async function analyzeProjectDependencies(options, pkgData, pkgFile) {
142
145
 
143
146
  const current = vm.getCurrentDependencies(pkg, options)
144
147
 
145
- print(options, `Fetching ${options.target} versions`, 'verbose')
148
+ print(options, '\nCurrent:', 'verbose')
149
+ print(options, current, 'verbose')
150
+
151
+ print(options, `\nFetching ${options.target} versions`, 'verbose')
146
152
 
147
153
  if (options.enginesNode) {
148
154
  options.enginesNode = _.get(pkg, 'engines.node')
149
155
  }
150
156
 
151
- print(options, '\nOptions:', 'verbose')
152
- print(options, sortOptions(options), 'verbose')
153
-
154
157
  if (options.peer) {
155
158
  options.peerDependencies = getPeerDependencies(current, options)
156
159
  }
package/lib/logging.js CHANGED
@@ -117,6 +117,9 @@ function printUpgrades(options, { current, upgraded, numUpgraded, total, ownersC
117
117
  if (Object.keys(current).length === 0) {
118
118
  print(options, 'No dependencies.')
119
119
  }
120
+ else if (Object.keys(upgraded).length === 0) {
121
+ print(options, `No upgrades were returned. This is likely a problem with your installed ${options.packageManager}, the npm registry, or your Internet connection. Make sure ${chalk.cyan('npx pacote packument ncu-test-v2')} is working before reporting an issue.`)
122
+ }
120
123
  else if (options.global) {
121
124
  print(options, `All global packages are up-to-date ${smiley}`)
122
125
  }
@@ -261,11 +261,12 @@ module.exports = {
261
261
  * @returns Promised {packageName: version} collection
262
262
  */
263
263
  async getPeerDependencies(packageName, version) {
264
+ const npmArgs = ['view', packageName + '@' + version, 'peerDependencies']
264
265
  const result = await spawnNpm(
265
- ['view', packageName + '@' + version, 'peerDependencies'],
266
+ npmArgs,
266
267
  {},
267
268
  { rejectOnError: false })
268
- return result ? parseJson(result, { command: 'npm view' }) : {}
269
+ return result ? parseJson(result, { command: `${npmArgs.join(' ')} --json` }) : {}
269
270
  },
270
271
 
271
272
  /**
@@ -281,7 +282,7 @@ module.exports = {
281
282
  ...options.cwd ? { cwd: options.cwd } : null,
282
283
  rejectOnError: false
283
284
  })
284
- const json = parseJson(result, { command: 'npm ls' })
285
+ const json = parseJson(result, { command: `npm ls --json${options.global ? '--global' : ''}` })
285
286
  return cint.mapObject(json.dependencies, (name, info) => ({
286
287
  // unmet peer dependencies have a different structure
287
288
  [name]: info.version || (info.required && info.required.version)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-check-updates",
3
- "version": "11.8.3",
3
+ "version": "11.8.4",
4
4
  "author": "Tomas Junnonen <tomas1@gmail.com>",
5
5
  "license": "Apache-2.0",
6
6
  "contributors": [
@@ -55,7 +55,7 @@
55
55
  "url": "https://github.com/raineorshine/npm-check-updates/issues"
56
56
  },
57
57
  "dependencies": {
58
- "chalk": "^4.1.1",
58
+ "chalk": "^4.1.2",
59
59
  "cint": "^8.2.1",
60
60
  "cli-table": "^0.3.6",
61
61
  "commander": "^6.2.1",
@@ -71,7 +71,7 @@
71
71
  "lodash": "^4.17.21",
72
72
  "minimatch": "^3.0.4",
73
73
  "p-map": "^4.0.0",
74
- "pacote": "^11.3.4",
74
+ "pacote": "^11.3.5",
75
75
  "parse-github-url": "^1.0.2",
76
76
  "progress": "^2.0.3",
77
77
  "prompts": "^2.4.1",
@@ -87,26 +87,26 @@
87
87
  "chai": "^4.3.4",
88
88
  "chai-as-promised": "^7.1.1",
89
89
  "chai-string": "^1.5.0",
90
- "chokidar-cli": "^2.1.0",
90
+ "chokidar-cli": "^3.0.0",
91
91
  "cross-env": "^7.0.3",
92
- "eslint": "^7.29.0",
92
+ "eslint": "^7.32.0",
93
93
  "eslint-config-raine": "^0.3.0",
94
94
  "eslint-config-standard": "^16.0.3",
95
95
  "eslint-plugin-fp": "^2.3.0",
96
- "eslint-plugin-import": "^2.23.4",
97
- "eslint-plugin-jsdoc": "^35.4.1",
96
+ "eslint-plugin-import": "^2.24.2",
97
+ "eslint-plugin-jsdoc": "^36.0.8",
98
98
  "eslint-plugin-node": "^11.1.0",
99
99
  "eslint-plugin-promise": "^5.1.0",
100
- "husky": "^7.0.0",
100
+ "husky": "^7.0.2",
101
101
  "lockfile-lint": "^4.6.2",
102
- "markdownlint-cli": "^0.27.1",
102
+ "markdownlint-cli": "^0.28.1",
103
103
  "mocha": "^8.4.0",
104
104
  "mock-require": "^3.0.3",
105
105
  "npm-run-all": "^4.1.5",
106
106
  "nyc": "^15.1.0",
107
107
  "should": "^13.2.3",
108
108
  "strip-ansi": "^6.0.0",
109
- "yarn": "^1.22.10"
109
+ "yarn": "^1.22.11"
110
110
  },
111
111
  "files": [
112
112
  "bin",