MCPcopy Create free account
hub / github.com/nodejs/node / exec

Method exec

deps/npm/lib/commands/link.js:46–65  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

44 }
45
46 async exec (args) {
47 if (this.npm.global) {
48 throw Object.assign(
49 new Error(
50 'link should never be --global.\n' +
51 'Please re-run this command with --local'
52 ),
53 { code: 'ELINKGLOBAL' }
54 )
55 }
56 // install-links is implicitly false when running `npm link`
57 this.npm.config.set('install-links', false)
58
59 // link with no args: symlink the folder to the global location
60 // link with package arg: symlink the global to the local
61 args = args.filter(a => resolve(a) !== this.npm.prefix)
62 return args.length
63 ? this.linkInstall(args)
64 : this.linkPkg()
65 }
66
67 async linkInstall (args) {
68 // load current packages from the global space, and then add symlinks installs locally

Callers

nothing calls this directly

Calls 6

linkInstallMethod · 0.95
linkPkgMethod · 0.95
assignMethod · 0.80
filterMethod · 0.65
resolveFunction · 0.50
setMethod · 0.45

Tested by

no test coverage detected