Skip to content

Commit 9dd32d0

Browse files
committed
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) PR-URL: #3485 Credit: @wraithgar Close: #3485 Reviewed-by: @isaacs
1 parent 5f8cccc commit 9dd32d0

File tree

2 files changed

+3
-41
lines changed

2 files changed

+3
-41
lines changed

docs/content/configuring-npm/package-json.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -549,12 +549,8 @@ had the following:
549549
}
550550
```
551551

552-
and then had a "start" command that then referenced the
553-
`npm_package_config_port` environment variable, then the user could
554-
override that by doing `npm config set foo:port 8001`.
555-
556-
See [`config`](/using-npm/config) and [`scripts`](/using-npm/scripts) for
557-
more on package configs.
552+
It could also have a "start" command that referenced the
553+
`npm_package_config_port` environment variable.
558554

559555
### dependencies
560556

docs/content/using-npm/scripts.md

+1-35
Original file line numberDiff line numberDiff line change
@@ -245,41 +245,7 @@ package.json file, then your package scripts would have the
245245
in your code with `process.env.npm_package_name` and
246246
`process.env.npm_package_version`, and so on for other fields.
247247

248-
#### configuration
249-
250-
Configuration parameters are put in the environment with the
251-
`npm_config_` prefix. For instance, you can view the effective `root`
252-
config by checking the `npm_config_root` environment variable.
253-
254-
#### Special: package.json "config" object
255-
256-
The package.json "config" keys are overwritten in the environment if
257-
there is a config param of `<name>[@<version>]:<key>`. For example,
258-
if the package.json has this:
259-
260-
```json
261-
{
262-
"name" : "foo",
263-
"config" : {
264-
"port" : "8080"
265-
},
266-
"scripts" : {
267-
"start" : "node server.js"
268-
}
269-
}
270-
```
271-
272-
and the server.js is this:
273-
274-
```javascript
275-
http.createServer(...).listen(process.env.npm_package_config_port)
276-
```
277-
278-
then the user could change the behavior by doing:
279-
280-
```bash
281-
npm config set foo:port 80
282-
```
248+
See [`package-json.md`](/using-npm/package-json) for more on package configs.
283249

284250
#### current lifecycle event
285251

0 commit comments

Comments
 (0)