From 44a347c632ce2b89beffa211c6b0de0b7400c572 Mon Sep 17 00:00:00 2001 From: Gar Date: Wed, 30 Jun 2021 13:38:18 -0700 Subject: [PATCH] fix(docs): remove npm package config override This is no longer possible, as per [rfc 21](https://github.com/npm/rfcs/blob/latest/implemented/0021-reduce-lifecycle-script-environment.md) --- docs/content/configuring-npm/package-json.md | 8 ++--- docs/content/using-npm/scripts.md | 36 +------------------- 2 files changed, 3 insertions(+), 41 deletions(-) diff --git a/docs/content/configuring-npm/package-json.md b/docs/content/configuring-npm/package-json.md index 3ed0399021447..5cacf68ba175f 100644 --- a/docs/content/configuring-npm/package-json.md +++ b/docs/content/configuring-npm/package-json.md @@ -549,12 +549,8 @@ had the following: } ``` -and then had a "start" command that then referenced the -`npm_package_config_port` environment variable, then the user could -override that by doing `npm config set foo:port 8001`. - -See [`config`](/using-npm/config) and [`scripts`](/using-npm/scripts) for -more on package configs. +It could also have a "start" command that referenced the +`npm_package_config_port` environment variable. ### dependencies diff --git a/docs/content/using-npm/scripts.md b/docs/content/using-npm/scripts.md index 3869334f6cc5a..2072d36c9a4b8 100644 --- a/docs/content/using-npm/scripts.md +++ b/docs/content/using-npm/scripts.md @@ -245,41 +245,7 @@ package.json file, then your package scripts would have the in your code with `process.env.npm_package_name` and `process.env.npm_package_version`, and so on for other fields. -#### configuration - -Configuration parameters are put in the environment with the -`npm_config_` prefix. For instance, you can view the effective `root` -config by checking the `npm_config_root` environment variable. - -#### Special: package.json "config" object - -The package.json "config" keys are overwritten in the environment if -there is a config param of `[@]:`. For example, -if the package.json has this: - -```json -{ - "name" : "foo", - "config" : { - "port" : "8080" - }, - "scripts" : { - "start" : "node server.js" - } -} -``` - -and the server.js is this: - -```javascript -http.createServer(...).listen(process.env.npm_package_config_port) -``` - -then the user could change the behavior by doing: - -```bash - npm config set foo:port 80 - ``` +See [`package-json.md`](/using-npm/package-json) for more on package configs. #### current lifecycle event