You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/arborist-cmd.js
+3-7Lines changed: 3 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,7 @@
1
1
const{ log }=require('proc-log')
2
2
constBaseCommand=require('./base-cmd.js')
3
3
4
-
// This is the base for all commands whose execWorkspaces just gets
5
-
// a list of workspace names and passes it on to new Arborist() to
6
-
// be able to run a filtered Arborist.reify() at some point.
4
+
// This is the base for all commands whose execWorkspaces just gets a list of workspace names and passes it on to new Arborist() to be able to run a filtered Arborist.reify() at some point.
7
5
classArboristCmdextendsBaseCommand{
8
6
getisArboristCmd(){
9
7
returntrue
@@ -25,8 +23,7 @@ class ArboristCmd extends BaseCommand {
25
23
26
24
const{ config }=this.npm
27
25
28
-
// when location isn't set and global isn't true check for a package.json at
29
-
// the localPrefix and set the location to project if found
26
+
// when location isn't set and global isn't true check for a package.json at the localPrefix and set the location to project if found
Copy file name to clipboardExpand all lines: lib/base-cmd.js
+4-8Lines changed: 4 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -17,8 +17,7 @@ class BaseCommand {
17
17
// Number of expected positional arguments (null = unlimited/unchecked)
18
18
staticpositionals=null
19
19
20
-
// this is a static so that we can read from it without instantiating a command
21
-
// which would require loading the config
20
+
// this is a static so that we can read from it without instantiating a command which would require loading the config
22
21
staticgetdescribeUsage(){
23
22
returnthis.getUsage()
24
23
}
@@ -29,8 +28,7 @@ class BaseCommand {
29
28
constwrapWidth=80
30
29
const{ description, usage =[''], name }=this
31
30
32
-
// Resolve to a definitions array: if the command has its own definitions, use
33
-
// those directly; otherwise resolve params from the global definitions pool.
31
+
// Resolve to a definitions array: if the command has its own definitions, use those directly; otherwise resolve params from the global definitions pool.
// Remove warnings for command-specific definitions that npm's global config
396
-
// doesn't know about (these were queued as "unknown" during config.load())
393
+
// Remove warnings for command-specific definitions that npm's global config doesn't know about (these were queued as "unknown" during config.load())
397
394
for(constdefofcommandDefinitions){
398
395
this.npm.config.removeWarning(def.key)
399
396
if(def.alias&&Array.isArray(def.alias)){
@@ -403,8 +400,7 @@ class BaseCommand {
403
400
}
404
401
}
405
402
406
-
// Remove warnings for unknown positionals that were actually consumed as flag values
407
-
// by command-specific definitions (e.g., --id <value> where --id is command-specific)
403
+
// Remove warnings for unknown positionals that were actually consumed as flag values by command-specific definitions (e.g., --id <value> where --id is command-specific)
// At this point we've required a few files and can be pretty sure we don't contain invalid syntax for this version of node. It's possible a lazy require would, but that's unlikely enough that it's not worth catching anymore and we attach the more important exit handlers.
22
+
// At this point we've required a few files and can be pretty sure we don't contain invalid syntax for this version of node.
23
+
// It's possible a lazy require would, but that's unlikely enough that it's not worth catching anymore and we attach the more important exit handlers.
24
24
validateEngines.off()
25
25
exitHandler.registerUncaughtHandlers()
26
26
27
-
// It is now safe to log a warning if they are using a version of node that is not going to fail on syntax errors but is still unsupported and untested and might not work reliably. This is safe to use the logger now which we want since this will show up in the error log too.
27
+
// It is now safe to log a warning if they are using a version of node that is not going to fail on syntax errors but is still unsupported and untested and might not work reliably.
28
+
// This is safe to use the logger now which we want since this will show up in the error log too.
// npm was never loaded but we still might have a config loading error or
151
-
// something similar that we can run through the error message formatter
152
-
// to give the user a clue as to what happened.s
148
+
// npm was never loaded but we still might have a config loading error or something similar that we can run through the error message formatter to give the user a clue as to what happened.
153
149
if(!this.#loaded){
154
150
this.#logConsoleError(newError('Exit prior to config file resolving',{cause: err}))
Copy file name to clipboardExpand all lines: lib/cli/validate-engines.js
+4-8Lines changed: 4 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,6 @@
1
-
// This is separate to indicate that it should contain code we expect to work in
2
-
// all versions of node >= 6. This is a best effort to catch syntax errors to
3
-
// give users a good error message if they are using a node version that doesn't
4
-
// allow syntax we are using such as private properties, etc. This file is
5
-
// linted with ecmaVersion=6 so we don't use invalid syntax, which is set in the
6
-
// .eslintrc.local.json file
1
+
// This is separate to indicate that it should contain code we expect to work in all versions of node >= 6.
2
+
// This is a best effort to catch syntax errors to give users a good error message if they are using a node version that doesn't allow syntax we are using such as private properties, etc.
3
+
// This file is linted with ecmaVersion=6 so we don't use invalid syntax, which is set in the .eslintrc.local.json file
7
4
8
5
const{engines: {node: engines}, version }=require('../../package.json')
constbrokenMessage=`ERROR: npm ${npm} is known not to run on Node.js ${node}. This version of npm supports the following node versions: \`${engines}\`. You can find the latest version at https://nodejs.org/.`
17
14
18
-
// coverage ignored because this is only hit in very unsupported node versions
19
-
// and it's a best effort attempt to show something nice in those cases
15
+
// coverage ignored because this is only hit in very unsupported node versions and it's a best effort attempt to show something nice in those cases
Copy file name to clipboardExpand all lines: lib/commands/cache.js
+7-15Lines changed: 7 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -131,20 +131,14 @@ class Cache extends BaseCommand {
131
131
constcachePath=this.npm.flatOptions.cache
132
132
if(args.length===0){
133
133
if(!this.npm.config.get('force')){
134
-
thrownewError(`As of npm@5, the npm cache self-heals from corruption issues
135
-
by treating integrity mismatches as cache misses. As a result,
136
-
data extracted from the cache is guaranteed to be valid. If you
137
-
want to make sure everything is consistent, use \`npm cache verify\`
138
-
instead. Deleting the cache can only make npm go slower, and is
139
-
not likely to correct any problems you may be encountering!
134
+
thrownewError(`As of npm@5, the npm cache self-heals from corruption issues by treating integrity mismatches as cache misses.
135
+
As a result, data extracted from the cache is guaranteed to be valid.
136
+
If you want to make sure everything is consistent, use \`npm cache verify\` instead.
137
+
Deleting the cache can only make npm go slower, and is not likely to correct any problems you may be encountering!
140
138
141
-
On the other hand, if you're debugging an issue with the installer,
142
-
or race conditions that depend on the timing of writing to an empty
143
-
cache, you can use \`npm install --cache /tmp/empty-cache\` to use a
144
-
temporary cache instead of nuking the actual one.
139
+
On the other hand, if you're debugging an issue with the installer, or race conditions that depend on the timing of writing to an empty cache, you can use \`npm install --cache /tmp/empty-cache\` to use a temporary cache instead of removing the actual one.
145
140
146
-
If you're sure you want to delete the entire cache, rerun this command
147
-
with --force.`)
141
+
If you're sure you want to delete the entire cache, rerun this command with --force.`)
0 commit comments