MCPcopy Create free account
hub / github.com/npm/cli / remediationLines

Function remediationLines

lib/utils/reify-output.js:276–289  ·  view source on GitHub ↗
(npm, names)

Source from the content-addressed store, hash-verified

274// the mechanism that does work globally: the `--allow-scripts` flag for a
275// one-off, or `npm config set allow-scripts` to persist it.
276const remediationLines = (npm, names) => {
277 if (npm.global) {
278 const list = names.join(',')
279 return [
280 `Run \`npm install -g --allow-scripts=${list}\` to allow these scripts ` +
281 `once, or \`${configSetAllowScripts(names)}\` to allow them for ` +
282 'all global installs.',
283 ]
284 }
285 return [
286 'Run `npm install-scripts ls` to review, ' +
287 'or `npm install-scripts approve <pkg>` to allow.',
288 ]
289}
290
291module.exports = reifyOutput

Callers 1

unreviewedScriptsMessageFunction · 0.85

Calls 1

configSetAllowScriptsFunction · 0.85

Tested by

no test coverage detected