X7ROOT File Manager
Current Path:
/opt/alt/alt-nodejs19/root/usr/lib/node_modules/npm/lib/commands
opt
/
alt
/
alt-nodejs19
/
root
/
usr
/
lib
/
node_modules
/
npm
/
lib
/
commands
/
ðŸ“
..
📄
access.js
(6.08 KB)
📄
adduser.js
(1.32 KB)
📄
audit.js
(13.86 KB)
📄
bugs.js
(815 B)
📄
cache.js
(7.07 KB)
📄
ci.js
(3.51 KB)
📄
completion.js
(8.73 KB)
📄
config.js
(10.04 KB)
📄
dedupe.js
(1.4 KB)
📄
deprecate.js
(2.03 KB)
📄
diff.js
(8.12 KB)
📄
dist-tag.js
(5.45 KB)
📄
docs.js
(447 B)
📄
doctor.js
(11.51 KB)
📄
edit.js
(2 KB)
📄
exec.js
(2.54 KB)
📄
explain.js
(3.55 KB)
📄
explore.js
(2.3 KB)
📄
find-dupes.js
(622 B)
📄
fund.js
(6.51 KB)
📄
get.js
(524 B)
📄
help-search.js
(5.49 KB)
📄
help.js
(3.54 KB)
📄
hook.js
(3.77 KB)
📄
init.js
(6.9 KB)
📄
install-ci-test.js
(373 B)
📄
install-test.js
(370 B)
📄
install.js
(5.11 KB)
📄
link.js
(5.15 KB)
📄
ll.js
(234 B)
📄
login.js
(1.32 KB)
📄
logout.js
(1.3 KB)
📄
ls.js
(16.73 KB)
📄
org.js
(4.14 KB)
📄
outdated.js
(8.76 KB)
📄
owner.js
(5.91 KB)
📄
pack.js
(2.37 KB)
📄
ping.js
(917 B)
📄
pkg.js
(3.5 KB)
📄
prefix.js
(303 B)
📄
profile.js
(11.19 KB)
📄
prune.js
(779 B)
📄
publish.js
(6.5 KB)
📄
query.js
(2.9 KB)
📄
rebuild.js
(2.14 KB)
📄
repo.js
(1.24 KB)
📄
restart.js
(310 B)
📄
root.js
(258 B)
📄
run-script.js
(6.81 KB)
📄
search.js
(2.68 KB)
📄
set.js
(572 B)
📄
shrinkwrap.js
(2.64 KB)
📄
star.js
(1.87 KB)
📄
stars.js
(1.03 KB)
📄
start.js
(300 B)
📄
stop.js
(295 B)
📄
team.js
(4.44 KB)
📄
test.js
(295 B)
📄
token.js
(6.64 KB)
📄
uninstall.js
(1.51 KB)
📄
unpublish.js
(4.54 KB)
📄
unstar.js
(182 B)
📄
update.js
(1.71 KB)
📄
version.js
(3.58 KB)
📄
view.js
(14.38 KB)
📄
whoami.js
(474 B)
Editing: ci.js
const Arborist = require('@npmcli/arborist') const reifyFinish = require('../utils/reify-finish.js') const runScript = require('@npmcli/run-script') const fs = require('fs/promises') const log = require('../utils/log-shim.js') const validateLockfile = require('../utils/validate-lockfile.js') const ArboristWorkspaceCmd = require('../arborist-cmd.js') const Install = require('./install.js') class CI extends ArboristWorkspaceCmd { static description = 'Clean install a project' static name = 'ci' static params = Install.params async exec () { if (this.npm.global) { throw Object.assign(new Error('`npm ci` does not work for global packages'), { code: 'ECIGLOBAL', }) } const where = this.npm.prefix const opts = { ...this.npm.flatOptions, packageLock: true, // npm ci should never skip lock files path: where, save: false, // npm ci should never modify the lockfile or package.json workspaces: this.workspaceNames, } const arb = new Arborist(opts) await arb.loadVirtual().catch(er => { log.verbose('loadVirtual', er.stack) const msg = 'The `npm ci` command can only install with an existing package-lock.json or\n' + 'npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or\n' + 'later to generate a package-lock.json file, then try again.' throw this.usageError(msg) }) // retrieves inventory of packages from loaded virtual tree (lock file) const virtualInventory = new Map(arb.virtualTree.inventory) // build ideal tree step needs to come right after retrieving the virtual // inventory since it's going to erase the previous ref to virtualTree await arb.buildIdealTree() // verifies that the packages from the ideal tree will match // the same versions that are present in the virtual tree (lock file) // throws a validation error in case of mismatches const errors = validateLockfile(virtualInventory, arb.idealTree.inventory) if (errors.length) { throw this.usageError( '`npm ci` can only install packages when your package.json and ' + 'package-lock.json or npm-shrinkwrap.json are in sync. Please ' + 'update your lock file with `npm install` ' + 'before continuing.\n\n' + errors.join('\n') ) } // Only remove node_modules after we've successfully loaded the virtual // tree and validated the lockfile await this.npm.time('npm-ci:rm', async () => { const path = `${where}/node_modules` // get the list of entries so we can skip the glob for performance const entries = await fs.readdir(path, null).catch(er => []) return Promise.all(entries.map(f => fs.rm(`${path}/${f}`, { force: true, recursive: true }))) }) await arb.reify(opts) const ignoreScripts = this.npm.config.get('ignore-scripts') // run the same set of scripts that `npm install` runs. if (!ignoreScripts) { const scripts = [ 'preinstall', 'install', 'postinstall', 'prepublish', // XXX should we remove this finally?? 'preprepare', 'prepare', 'postprepare', ] const scriptShell = this.npm.config.get('script-shell') || undefined for (const event of scripts) { await runScript({ path: where, args: [], scriptShell, stdio: 'inherit', banner: !this.npm.silent, event, }) } } await reifyFinish(this.npm, arb) } } module.exports = CI
Upload File
Create Folder