summaryrefslogtreecommitdiff
path: root/deps/npm/lib/install.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/lib/install.js')
-rw-r--r--deps/npm/lib/install.js20
1 files changed, 17 insertions, 3 deletions
diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js
index 8df63a219e..54ea6d8251 100644
--- a/deps/npm/lib/install.js
+++ b/deps/npm/lib/install.js
@@ -12,11 +12,24 @@ const runScript = require('@npmcli/run-script')
const BaseCommand = require('./base-command.js')
class Install extends BaseCommand {
/* istanbul ignore next - see test/lib/load-all-commands.js */
+ static get description () {
+ return 'Install a package'
+ }
+
+ /* istanbul ignore next - see test/lib/load-all-commands.js */
static get name () {
return 'install'
}
/* istanbul ignore next - see test/lib/load-all-commands.js */
+ static get params () {
+ return [
+ 'save',
+ 'save-exact',
+ ]
+ }
+
+ /* istanbul ignore next - see test/lib/load-all-commands.js */
static get usage () {
return [
'[<@scope>/]<pkg>',
@@ -28,7 +41,7 @@ class Install extends BaseCommand {
'<tarball file>',
'<tarball url>',
'<git:// url>',
- '<github username>/<github project> [--save-prod|--save-dev|--save-optional|--save-peer] [--save-exact] [--no-save]',
+ '<github username>/<github project>',
]
}
@@ -98,7 +111,8 @@ class Install extends BaseCommand {
async install (args) {
// the /path/to/node_modules/..
const globalTop = resolve(this.npm.globalDir, '..')
- const { ignoreScripts, global: isGlobalInstall } = this.npm.flatOptions
+ const ignoreScripts = this.npm.config.get('ignore-scripts')
+ const isGlobalInstall = this.npm.config.get('global')
const where = isGlobalInstall ? globalTop : this.npm.prefix
// don't try to install the prefix into itself
@@ -122,7 +136,7 @@ class Install extends BaseCommand {
add: args,
})
if (!args.length && !isGlobalInstall && !ignoreScripts) {
- const { scriptShell } = this.npm.flatOptions
+ const scriptShell = this.npm.config.get('script-shell') || undefined
const scripts = [
'preinstall',
'install',