Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2021-03-22 21:51:38 +0300
committerRuy Adorno <ruyadorno@hotmail.com>2021-03-22 22:08:22 +0300
commit93a061d737dc769663652368e8586e4202267b9e (patch)
treebeb127b31b53fa42abbf739dcbfc958621289c49 /lib
parente1b3b318f095a7e1a7cc4b131907de4955275d9d (diff)
fix(usage): add action items to error output
PR-URL: https://github.com/npm/cli/pull/2917 Credit: @wraithgar Close: #2917 Reviewed-by: @ruyadorno
Diffstat (limited to 'lib')
-rw-r--r--lib/cli.js2
-rw-r--r--lib/run-script.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/cli.js b/lib/cli.js
index 087922465..46859f150 100644
--- a/lib/cli.js
+++ b/lib/cli.js
@@ -67,7 +67,7 @@ module.exports = (process) => {
if (cmd) {
const didYouMean = require('./utils/did-you-mean.js')
const suggestions = await didYouMean(npm, npm.localPrefix, cmd)
- npm.output(`Unknown command: "${cmd}"${suggestions}`)
+ npm.output(`Unknown command: "${cmd}"${suggestions}\n\nTo see a list of supported npm commands, run:\n npm help`)
} else
npm.output(npm.usage)
process.exitCode = 1
diff --git a/lib/run-script.js b/lib/run-script.js
index 61572561a..0297061ad 100644
--- a/lib/run-script.js
+++ b/lib/run-script.js
@@ -91,7 +91,7 @@ class RunScript extends BaseCommand {
return
const suggestions = await didYouMean(this.npm, path, event)
- throw new Error(`Missing script: "${event}"${suggestions}`)
+ throw new Error(`Missing script: "${event}"${suggestions}\n\nTo see a list of scripts, run:\n npm run`)
}
// positional args only added to the main event, not pre/post