1 ---
2 title: package.json
3 section: 5
4 description: Specifics of npm's package.json handling
5 github_repo: npm/cli
6 github_branch: release/v6
7 github_path: docs/content/configuring-npm/package-json.md
8 redirect_from:
9 - /cli-documentation/v6/configuring-npm/package-json
10 - /cli-documentation/v6/configuring-npm/package.json
11 - /cli-documentation/v6/files/package-json
12 - /cli-documentation/v6/files/package.json
13 - /cli/v6/configuring-npm/package.json
14 - /cli/v6/files/package-json
15 - /cli/v6/files/package.json
16 ---
17
18 ### Description
19
20 This document is all you need to know about what's required in your package.json file. It must be actual JSON, not just a JavaScript object literal.
21
22 A lot of the behavior described in this document is affected by the config settings described in [`config`](/cli/v6/using-npm/config).
23
24 ### name
25
26 If you plan to publish your package, the _most_ important things in your package.json are the name and version fields as they will be required. The name and version together form an identifier that is assumed to be completely unique. Changes to the package should come along with changes to the version. If you don't plan to publish your package, the name and version fields are optional.
27
28 The name is what your thing is called.
29
30 Some rules:
31
32 - The name must be less than or equal to 214 characters. This includes the scope for scoped packages.
33 - The names of scoped packages can begin with a dot or an underscore. This is not permitted without a scope.
34 - New packages must not have uppercase letters in the name.
35 - The name ends up being part of a URL, an argument on the command line, and a folder name. Therefore, the name can't contain any non-URL-safe characters.
36
37 Some tips:
38
39 - Don't use the same name as a core Node module.
40 - Don't put "js" or "node" in the name. It's assumed that it's js, since you're writing a package.json file, and you can specify the engine using the "engines" field. (See below.)
41 - The name will probably be passed as an argument to require(), so it should be something short, but also reasonably descriptive.
42 - You may want to check the npm registry to see if there's something by that name already, before you get too attached to it. [https://www.npmjs.com/](https://www.npmjs.com/)
43
44 A name can be optionally prefixed by a scope, e.g. `@myorg/mypackage`. See [`scope`](/cli/v6/using-npm/scope) for more detail.
45
46 ### version
47
48 If you plan to publish your package, the _most_ important things in your package.json are the name and version fields as they will be required. The name and version together form an identifier that is assumed to be completely unique. Changes to the package should come along with changes to the version. If you don't plan to publish your package, the name and version fields are optional.
49
50 Version must be parseable by [node-semver](https://github.com/isaacs/node-semver), which is bundled with npm as a dependency. (`npm install semver` to use it yourself.)
51
52 More on version numbers and ranges at [semver](/cli/v6/using-npm/semver).
53
54 ### description
55
56 Put a description in it. It's a string. This helps people discover your package, as it's listed in `npm search`.
57
58 ### keywords
59
60 Put keywords in it. It's an array of strings. This helps people discover your package as it's listed in `npm search`.
61
62 ### homepage
63
64 The url to the project homepage.
65
66 Example:
67
68 ```json
69 "homepage": "https://github.com/owner/project#readme"
70 ```
71
72 ### bugs
73
74 The url to your project's issue tracker and / or the email address to which issues should be reported. These are helpful for people who encounter issues with your package.
75
76 It should look like this:
77
78 ```json
79 {
80 "url": "https://github.com/owner/project/issues",
81 "email": "project@hostname.com"
82 }
83 ```
84
85 You can specify either one or both values. If you want to provide only a url, you can specify the value for "bugs" as a simple string instead of an object.
86
87 If a url is provided, it will be used by the `npm bugs` command.
88
89 ### license
90
91 You should specify a license for your package so that people know how they are permitted to use it, and any restrictions you're placing on it.
92
93 If you're using a common license such as BSD-2-Clause or MIT, add a current SPDX license identifier for the license you're using, like this:
94
95 ```json
96 { "license": "BSD-3-Clause" }
97 ```
98
99 You can check [the full list of SPDX license IDs](https://spdx.org/licenses/). Ideally you should pick one that is [OSI](https://opensource.org/licenses/alphabetical) approved.
100
101 If your package is licensed under multiple common licenses, use an [SPDX license expression syntax version 2.0 string](https://www.npmjs.com/package/spdx), like this:
102
103 ```json
104 { "license": "(ISC OR GPL-3.0)" }
105 ```
106
107 If you are using a license that hasn't been assigned an SPDX identifier, or if you are using a custom license, use a string value like this one:
108
109 ```json
110 { "license": "SEE LICENSE IN <filename>" }
111 ```
112
113 Then include a file named `<filename>` at the top level of the package.
114
115 Some old packages used license objects or a "licenses" property containing an array of license objects:
116
117 ```json
118 // Not valid metadata
119 { "license" :
120 { "type" : "ISC"
121 , "url" : "https://opensource.org/licenses/ISC"
122 }
123 }
124
125 // Not valid metadata
126 { "licenses" :
127 [
128 { "type": "MIT"
129 , "url": "https://www.opensource.org/licenses/mit-license.php"
130 }
131 , { "type": "Apache-2.0"
132 , "url": "https://opensource.org/licenses/apache2.0.php"
133 }
134 ]
135 }
136 ```
137
138 Those styles are now deprecated. Instead, use SPDX expressions, like this:
139
140 ```json
141 { "license": "ISC" }
142
143 { "license": "(MIT OR Apache-2.0)" }
144 ```
145
146 Finally, if you do not wish to grant others the right to use a private or unpublished package under any terms:
147
148 ```json
149 { "license": "UNLICENSED" }
150 ```
151
152 Consider also setting `"private": true` to prevent accidental publication.
153
154 ### people fields: author, contributors
155
156 The "author" is one person. "contributors" is an array of people. A "person" is an object with a "name" field and optionally "url" and "email", like this:
157
158 ```json
159 {
160 "name": "Barney Rubble",
161 "email": "b@rubble.com",
162 "url": "http://barnyrubble.tumblr.com/"
163 }
164 ```
165
166 Or you can shorten that all into a single string, and npm will parse it for you:
167
168 ```json
169 "Barney Rubble <b@rubble.com> (http://barnyrubble.tumblr.com/)"
170 ```
171
172 Both email and url are optional either way.
173
174 npm also sets a top-level "maintainers" field with your npm user info.
175
176 ### funding
177
178 You can specify an object containing an URL that provides up-to-date information about ways to help fund development of your package, or a string URL, or an array of these:
179
180 ```json
181 "funding": {
182 "type" : "individual",
183 "url" : "http://example.com/donate"
184 }
185
186 "funding": {
187 "type" : "patreon",
188 "url" : "https://www.patreon.com/my-account"
189 }
190
191 "funding": "http://example.com/donate"
192
193 "funding": [
194 {
195 "type" : "individual",
196 "url" : "http://example.com/donate"
197 },
198 "http://example.com/donateAlso",
199 {
200 "type" : "patreon",
201 "url" : "https://www.patreon.com/my-account"
202 }
203 ]
204 ```
205
206 Users can use the `npm fund` subcommand to list the `funding` URLs of all dependencies of their project, direct and indirect. A shortcut to visit each funding url is also available when providing the project name such as: `npm fund <projectname>` (when there are multiple URLs, the first one will be visited)
207
208 ### files
209
210 The optional `files` field is an array of file patterns that describes the entries to be included when your package is installed as a dependency. File patterns follow a similar syntax to `.gitignore`, but reversed: including a file, directory, or glob pattern (`*`, `**/*`, and such) will make it so that file is included in the tarball when it's packed. Omitting the field will make it default to `["*"]`, which means it will include all files.
211
212 Some special files and directories are also included or excluded regardless of whether they exist in the `files` array (see below).
213
214 You can also provide a `.npmignore` file in the root of your package or in subdirectories, which will keep files from being included. At the root of your package it will not override the "files" field, but in subdirectories it will. The `.npmignore` file works just like a `.gitignore`. If there is a `.gitignore` file, and `.npmignore` is missing, `.gitignore`'s contents will be used instead.
215
216 Files included with the "package.json#files" field _cannot_ be excluded through `.npmignore` or `.gitignore`.
217
218 Certain files are always included, regardless of settings:
219
220 - `package.json`
221 - `README`
222 - `CHANGES` / `CHANGELOG` / `HISTORY`
223 - `LICENSE` / `LICENCE`
224 - `NOTICE`
225 - The file in the "main" field
226
227 `README`, `CHANGES`, `LICENSE` & `NOTICE` can have any case and extension.
228
229 Conversely, some files are always ignored:
230
231 - `.git`
232 - `CVS`
233 - `.svn`
234 - `.hg`
235 - `.lock-wscript`
236 - `.wafpickle-N`
237 - `.DS_Store`
238 - `npm-debug.log`
239 - `.npmrc`
240 - `node_modules`
241 - `config.gypi`
242 - `package-lock.json` (use shrinkwrap instead)
243 - All files containing a `*` character (incompatible with Windows)
244
245 ### main
246
247 The main field is a module ID that is the primary entry point to your program. That is, if your package is named `foo`, and a user installs it, and then does `require("foo")`, then your main module's exports object will be returned.
248
249 This should be a module ID relative to the root of your package folder.
250
251 For most modules, it makes the most sense to have a main script and often not much else.
252
253 ### browser
254
255 If your module is meant to be used client-side the browser field should be used instead of the main field. This is helpful to hint users that it might rely on primitives that aren't available in Node.js modules. (e.g. `window`)
256
257 ### bin
258
259 A lot of packages have one or more executable files that they'd like to install into the PATH. npm makes this pretty easy (in fact, it uses this feature to install the "npm" executable.)
260
261 To use this, supply a `bin` field in your package.json which is a map of command name to local file name. On install, npm will symlink that file into `prefix/bin` for global installs, or `./node_modules/.bin/` for local installs.
262
263 For example, myapp could have this:
264
265 ```json
266 { "bin": { "myapp": "./cli.js" } }
267 ```
268
269 So, when you install myapp, it'll create a symlink from the `cli.js` script to `/usr/local/bin/myapp`.
270
271 If you have a single executable, and its name should be the name of the package, then you can just supply it as a string. For example:
272
273 ```json
274 { "name": "my-program", "version": "1.2.5", "bin": "./path/to/program" }
275 ```
276
277 would be the same as this:
278
279 ```json
280 {
281 "name": "my-program",
282 "version": "1.2.5",
283 "bin": { "my-program": "./path/to/program" }
284 }
285 ```
286
287 Please make sure that your file(s) referenced in `bin` starts with `#!/usr/bin/env node`, otherwise the scripts are started without the node executable!
288
289 ### man
290
291 Specify either a single file or an array of filenames to put in place for the `man` program to find.
292
293 If only a single file is provided, then it's installed such that it is the result from `man <pkgname>`, regardless of its actual filename. For example:
294
295 ```json
296 {
297 "name": "foo",
298 "version": "1.2.3",
299 "description": "A packaged foo fooer for fooing foos",
300 "main": "foo.js",
301 "man": "./man/doc.1"
302 }
303 ```
304
305 would link the `./man/doc.1` file in such that it is the target for `man foo`
306
307 If the filename doesn't start with the package name, then it's prefixed. So, this:
308
309 ```json
310 {
311 "name": "foo",
312 "version": "1.2.3",
313 "description": "A packaged foo fooer for fooing foos",
314 "main": "foo.js",
315 "man": ["./man/foo.1", "./man/bar.1"]
316 }
317 ```
318
319 will create files to do `man foo` and `man foo-bar`.
320
321 Man files must end with a number, and optionally a `.gz` suffix if they are compressed. The number dictates which man section the file is installed into.
322
323 ```json
324 {
325 "name": "foo",
326 "version": "1.2.3",
327 "description": "A packaged foo fooer for fooing foos",
328 "main": "foo.js",
329 "man": ["./man/foo.1", "./man/foo.2"]
330 }
331 ```
332
333 will create entries for `man foo` and `man 2 foo`
334
335 ### directories
336
337 The CommonJS [Packages](http://wiki.commonjs.org/wiki/Packages/1.0) spec details a few ways that you can indicate the structure of your package using a `directories` object. If you look at [npm's package.json](https://registry.npmjs.org/npm/latest), you'll see that it has directories for doc, lib, and man.
338
339 In the future, this information may be used in other creative ways.
340
341 #### directories.lib
342
343 Tell people where the bulk of your library is. Nothing special is done with the lib folder in any way, but it's useful meta info.
344
345 #### directories.bin
346
347 If you specify a `bin` directory in `directories.bin`, all the files in that folder will be added.
348
349 Because of the way the `bin` directive works, specifying both a `bin` path and setting `directories.bin` is an error. If you want to specify individual files, use `bin`, and for all the files in an existing `bin` directory, use `directories.bin`.
350
351 #### directories.man
352
353 A folder that is full of man pages. Sugar to generate a "man" array by walking the folder.
354
355 #### directories.doc
356
357 Put markdown files in here. Eventually, these will be displayed nicely, maybe, someday.
358
359 #### directories.example
360
361 Put example scripts in here. Someday, it might be exposed in some clever way.
362
363 #### directories.test
364
365 Put your tests in here. It is currently not exposed, but it might be in the future.
366
367 ### repository
368
369 Specify the place where your code lives. This is helpful for people who want to contribute. If the git repo is on GitHub, then the `npm docs` command will be able to find you.
370
371 Do it like this:
372
373 ```json
374 "repository": {
375 "type" : "git",
376 "url" : "https://github.com/npm/cli.git"
377 }
378
379 "repository": {
380 "type" : "svn",
381 "url" : "https://v8.googlecode.com/svn/trunk/"
382 }
383 ```
384
385 The URL should be a publicly available (perhaps read-only) url that can be handed directly to a VCS program without any modification. It should not be a url to an html project page that you put in your browser. It's for computers.
386
387 For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same shortcut syntax you use for `npm install`:
388
389 ```json
390 "repository": "npm/npm"
391
392 "repository": "github:user/repo"
393
394 "repository": "gist:11081aaa281"
395
396 "repository": "bitbucket:user/repo"
397
398 "repository": "gitlab:user/repo"
399 ```
400
401 If the `package.json` for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives:
402
403 ```json
404 "repository": {
405 "type" : "git",
406 "url" : "https://github.com/facebook/react.git",
407 "directory": "packages/react-dom"
408 }
409 ```
410
411 ### scripts
412
413 The "scripts" property is a dictionary containing script commands that are run at various times in the lifecycle of your package. The key is the lifecycle event, and the value is the command to run at that point.
414
415 See [`scripts`](/cli/v6/using-npm/scripts) to find out more about writing package scripts.
416
417 ### config
418
419 A "config" object can be used to set configuration parameters used in package scripts that persist across upgrades. For instance, if a package had the following:
420
421 ```json
422 { "name": "foo", "config": { "port": "8080" } }
423 ```
424
425 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`.
426
427 See [`config`](/cli/v6/using-npm/config) and [`scripts`](/cli/v6/using-npm/scripts) for more on package configs.
428
429 ### dependencies
430
431 Dependencies are specified in a simple object that maps a package name to a version range. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL.
432
433 **Please do not put test harnesses or transpilers in your `dependencies` object.** See `devDependencies`, below.
434
435 See [semver](/cli/v6/using-npm/semver) for more details about specifying version ranges.
436
437 - `version` Must match `version` exactly
438 - `>version` Must be greater than `version`
439 - `>=version` etc
440 - `<version`
441 - `<=version`
442 - `~version` "Approximately equivalent to version" See [semver](/cli/v6/using-npm/semver)
443 - `^version` "Compatible with version" See [semver](/cli/v6/using-npm/semver)
444 - `1.2.x` 1.2.0, 1.2.1, etc., but not 1.3.0
445 - `http://...` See 'URLs as Dependencies' below
446 - `*` Matches any version
447 - `""` (just an empty string) Same as `*`
448 - `version1 - version2` Same as `>=version1 <=version2`.
449 - `range1 || range2` Passes if either range1 or range2 are satisfied.
450 - `git...` See 'Git URLs as Dependencies' below
451 - `user/repo` See 'GitHub URLs' below
452 - `tag` A specific version tagged and published as `tag` See [`npm dist-tag`](/cli/v6/commands/npm-dist-tag)
453 - `path/path/path` See [Local Paths](#local-paths) below
454
455 For example, these are all valid:
456
457 ```json
458 {
459 "dependencies": {
460 "foo": "1.0.0 - 2.9999.9999",
461 "bar": ">=1.0.2 <2.1.2",
462 "baz": ">1.0.2 <=2.3.4",
463 "boo": "2.0.1",
464 "qux": "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0",
465 "asd": "http://asdf.com/asdf.tar.gz",
466 "til": "~1.2",
467 "elf": "~1.2.3",
468 "two": "2.x",
469 "thr": "3.3.x",
470 "lat": "latest",
471 "dyl": "file:../dyl"
472 }
473 }
474 ```
475
476 #### URLs as Dependencies
477
478 You may specify a tarball URL in place of a version range.
479
480 This tarball will be downloaded and installed locally to your package at install time.
481
482 #### Git URLs as Dependencies
483
484 Git urls are of the form:
485
486 ```bash
487 <protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>[#<commit-ish> | #semver:<semver>]
488 ```
489
490 `<protocol>` is one of `git`, `git+ssh`, `git+http`, `git+https`, or `git+file`.
491
492 If `#<commit-ish>` is provided, it will be used to clone exactly that commit. If the commit-ish has the format `#semver:<semver>`, `<semver>` can be any valid semver range or exact version, and npm will look for any tags or refs matching that range in the remote repository, much as it would for a registry dependency. If neither `#<commit-ish>` or `#semver:<semver>` is specified, then `master` is used.
493
494 Examples:
495
496 ```bash
497 git+ssh://git@github.com:npm/cli.git#v1.0.27
498 git+ssh://git@github.com:npm/cli#semver:^5.0
499 git+https://isaacs@github.com/npm/cli.git
500 git://github.com/npm/cli.git#v1.0.27
501 ```
502
503 #### GitHub URLs
504
505 As of version 1.1.65, you can refer to GitHub urls as just "foo": "user/foo-project". Just as with git URLs, a `commit-ish` suffix can be included. For example:
506
507 ```json
508 {
509 "name": "foo",
510 "version": "0.0.0",
511 "dependencies": {
512 "express": "expressjs/express",
513 "mocha": "mochajs/mocha#4727d357ea",
514 "module": "user/repo#feature/branch"
515 }
516 }
517 ```
518
519 #### Local Paths
520
521 As of version 2.0.0 you can provide a path to a local directory that contains a package. Local paths can be saved using `npm install -S` or `npm install --save`, using any of these forms:
522
523 ```bash
524 ../foo/bar
525 ~/foo/bar
526 ./foo/bar
527 /foo/bar
528 ```
529
530 in which case they will be normalized to a relative path and added to your `package.json`. For example:
531
532 ```json
533 {
534 "name": "baz",
535 "dependencies": {
536 "bar": "file:../foo/bar"
537 }
538 }
539 ```
540
541 This feature is helpful for local offline development and creating tests that require npm installing where you don't want to hit an external server, but should not be used when publishing packages to the public registry.
542
543 ### devDependencies
544
545 If someone is planning on downloading and using your module in their program, then they probably don't want or need to download and build the external test or documentation framework that you use.
546
547 In this case, it's best to map these additional items in a `devDependencies` object.
548
549 These things will be installed when doing `npm link` or `npm install` from the root of a package, and can be managed like any other npm configuration param. See [`config`](/cli/v6/using-npm/config) for more on the topic.
550
551 For build steps that are not platform-specific, such as compiling CoffeeScript or other languages to JavaScript, use the `prepare` script to do this, and make the required package a devDependency.
552
553 For example:
554
555 ```json
556 {
557 "name": "ethopia-waza",
558 "description": "a delightfully fruity coffee varietal",
559 "version": "1.2.3",
560 "devDependencies": {
561 "coffee-script": "~1.6.3"
562 },
563 "scripts": {
564 "prepare": "coffee -o lib/ -c src/waza.coffee"
565 },
566 "main": "lib/waza.js"
567 }
568 ```
569
570 The `prepare` script will be run before publishing, so that users can consume the functionality without requiring them to compile it themselves. In dev mode (ie, locally running `npm install`), it'll run this script as well, so that you can test it easily.
571
572 ### peerDependencies
573
574 In some cases, you want to express the compatibility of your package with a host tool or library, while not necessarily doing a `require` of this host. This is usually referred to as a _plugin_. Notably, your module may be exposing a specific interface, expected and specified by the host documentation.
575
576 For example:
577
578 ```json
579 {
580 "name": "tea-latte",
581 "version": "1.3.5",
582 "peerDependencies": {
583 "tea": "2.x"
584 }
585 }
586 ```
587
588 This ensures your package `tea-latte` can be installed _along_ with the second major version of the host package `tea` only. `npm install tea-latte` could possibly yield the following dependency graph:
589
590 ```bash
591 ├── tea-latte@1.3.5
592 └── tea@2.2.0
593 ```
594
595 **NOTE: npm versions 1 and 2 will automatically install `peerDependencies` if they are not explicitly depended upon higher in the dependency tree. In the next major version of npm (npm@3), this will no longer be the case. You will receive a warning that the peerDependency is not installed instead.** The behavior in npms 1 & 2 was frequently confusing and could easily put you into dependency hell, a situation that npm is designed to avoid as much as possible.
596
597 Trying to install another plugin with a conflicting requirement will cause an error. For this reason, make sure your plugin requirement is as broad as possible, and not to lock it down to specific patch versions.
598
599 Assuming the host complies with [semver](https://semver.org/), only changes in the host package's major version will break your plugin. Thus, if you've worked with every 1.x version of the host package, use `"^1.0"` or `"1.x"` to express this. If you depend on features introduced in 1.5.2, use `">= 1.5.2 < 2"`.
600
601 ### bundledDependencies
602
603 This defines an array of package names that will be bundled when publishing the package.
604
605 In cases where you need to preserve npm packages locally or have them available through a single file download, you can bundle the packages in a tarball file by specifying the package names in the `bundledDependencies` array and executing `npm pack`.
606
607 For example:
608
609 If we define a package.json like this:
610
611 ```json
612 {
613 "name": "awesome-web-framework",
614 "version": "1.0.0",
615 "bundledDependencies": ["renderized", "super-streams"]
616 }
617 ```
618
619 we can obtain `awesome-web-framework-1.0.0.tgz` file by running `npm pack`. This file contains the dependencies `renderized` and `super-streams` which can be installed in a new project by executing `npm install awesome-web-framework-1.0.0.tgz`. Note that the package names do not include any versions, as that information is specified in `dependencies`.
620
621 If this is spelled `"bundleDependencies"`, then that is also honored.
622
623 ### optionalDependencies
624
625 If a dependency can be used, but you would like npm to proceed if it cannot be found or fails to install, then you may put it in the `optionalDependencies` object. This is a map of package name to version or url, just like the `dependencies` object. The difference is that build failures do not cause installation to fail. Running `npm install --no-optional` will prevent these dependencies from being installed.
626
627 It is still your program's responsibility to handle the lack of the dependency. For example, something like this:
628
629 ```js
630 try {
631 var foo = require("foo");
632 var fooVersion = require("foo/package.json").version;
633 } catch (er) {
634 foo = null;
635 }
636 if (notGoodFooVersion(fooVersion)) {
637 foo = null;
638 }
639
640 // .. then later in your program ..
641
642 if (foo) {
643 foo.doFooThings();
644 }
645 ```
646
647 Entries in `optionalDependencies` will override entries of the same name in `dependencies`, so it's usually best to only put in one place.
648
649 ### engines
650
651 You can specify the version of node that your stuff works on:
652
653 ```json
654 { "engines": { "node": ">=0.10.3 <0.12" } }
655 ```
656
657 And, like with dependencies, if you don't specify the version (or if you specify "\*" as the version), then any version of node will do.
658
659 If you specify an "engines" field, then npm will require that "node" be somewhere on that list. If "engines" is omitted, then npm will just assume that it works on node.
660
661 You can also use the "engines" field to specify which versions of npm are capable of properly installing your program. For example:
662
663 ```json
664 { "engines": { "npm": "~1.0.20" } }
665 ```
666
667 Unless the user has set the `engine-strict` config flag, this field is advisory only and will only produce warnings when your package is installed as a dependency.
668
669 ### engineStrict
670
671 **This feature was removed in npm 3.0.0**
672
673 Prior to npm 3.0.0, this feature was used to treat this package as if the user had set `engine-strict`. It is no longer used.
674
675 ### os
676
677 You can specify which operating systems your module will run on:
678
679 ```json
680 "os" : [ "darwin", "linux" ]
681 ```
682
683 You can also blacklist instead of whitelist operating systems, just prepend the blacklisted os with a '!':
684
685 ```json
686 "os" : [ "!win32" ]
687 ```
688
689 The host operating system is determined by `process.platform`
690
691 It is allowed to both blacklist, and whitelist, although there isn't any good reason to do this.
692
693 ### cpu
694
695 If your code only runs on certain cpu architectures, you can specify which ones.
696
697 ```json
698 "cpu" : [ "x64", "ia32" ]
699 ```
700
701 Like the `os` option, you can also blacklist architectures:
702
703 ```json
704 "cpu" : [ "!arm", "!mips" ]
705 ```
706
707 The host architecture is determined by `process.arch`
708
709 ### preferGlobal
710
711 **DEPRECATED**
712
713 This option used to trigger an npm warning, but it will no longer warn. It is purely there for informational purposes. It is now recommended that you install any binaries as local devDependencies wherever possible.
714
715 ### private
716
717 If you set `"private": true` in your package.json, then npm will refuse to publish it.
718
719 This is a way to prevent accidental publication of private repositories. If you would like to ensure that a given package is only ever published to a specific registry (for example, an internal registry), then use the `publishConfig` dictionary described below to override the `registry` config param at publish-time.
720
721 ### publishConfig
722
723 This is a set of config values that will be used at publish-time. It's especially handy if you want to set the tag, registry or access, so that you can ensure that a given package is not tagged with "latest", published to the global public registry or that a scoped module is private by default.
724
725 Any config values can be overridden, but only "tag", "registry" and "access" probably matter for the purposes of publishing.
726
727 See [`config`](/cli/v6/using-npm/config) to see the list of config options that can be overridden.
728
729 ### DEFAULT VALUES
730
731 npm will default some values based on package contents.
732
733 - `"scripts": {"start": "node server.js"}`
734
735 If there is a `server.js` file in the root of your package, then npm will default the `start` command to `node server.js`.
736
737 - `"scripts":{"install": "node-gyp rebuild"}`
738
739 If there is a `binding.gyp` file in the root of your package and you have not defined an `install` or `preinstall` script, npm will default the `install` command to compile using node-gyp.
740
741 - `"contributors": [...]`
742
743 If there is an `AUTHORS` file in the root of your package, npm will treat each line as a `Name <email> (url)` format, where email and url are optional. Lines which start with a `#` or are blank, will be ignored.
744
745 ### SEE ALSO
746
747 - [semver](/cli/v6/using-npm/semver)
748 - [npm init](/cli/v6/commands/npm-init)
749 - [npm version](/cli/v6/commands/npm-version)
750 - [npm config](/cli/v6/commands/npm-config)
751 - [npm help](/cli/v6/commands/npm-help)
752 - [npm install](/cli/v6/commands/npm-install)
753 - [npm publish](/cli/v6/commands/npm-publish)
754 - [npm uninstall](/cli/v6/commands/npm-uninstall)