You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/cli/v10/commands/npm-install.mdx
-2Lines changed: 0 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -164,8 +164,6 @@ Even if you never publish your package, you can still get a lot of benefits of u
164
164
npm install ansi-regex --save-bundle
165
165
```
166
166
167
-
**Note**: If there is a file or folder named `<name>` in the current working directory, then it will try to install that, and only try to fetch the package by name if it is not valid.
168
-
169
167
-`npm install <alias>@npm:<name>`:
170
168
171
169
Install a package under a custom alias. Allows multiple versions of a same-name package side-by-side, more convenient import names for packages with otherwise long ones, and using git forks replacements or forked npm packages as replacements. Aliasing works only on your project and does not rename packages in transitive dependencies. Aliases should follow the naming conventions stated in [`validate-npm-package-name`](https://www.npmjs.com/package/validate-npm-package-name#naming-rules).
Copy file name to clipboardExpand all lines: content/cli/v10/commands/npm-ls.mdx
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ Note: to get a "bottoms up" view of why a given package is included in the tree
52
52
Positional arguments are `name@version-range` identifiers, which will limit the results to only the paths to the packages named. Note that nested packages will _also_ show the paths to the specified packages. For example, running `npm ls promzard` in npm's source tree will show:
Copy file name to clipboardExpand all lines: content/cli/v10/configuring-npm/package-json.mdx
+29Lines changed: 29 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -299,6 +299,10 @@ Most of these ignored files can be included specifically if included in the `fil
299
299
300
300
These can not be included.
301
301
302
+
### exports
303
+
304
+
The "exports" provides a modern alternative to "main" allowing multiple entry points to be defined, conditional entry resolution support between environments, and preventing any other entry points besides those defined in "exports". This encapsulation allows module authors to clearly define the public interface for their package. For more details see the [node.js documentation on package entry points](https://nodejs.org/api/packages.html#package-entry-points)
305
+
302
306
### main
303
307
304
308
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.
@@ -905,6 +909,31 @@ Like the `os` option, you can also block architectures:
905
909
906
910
The host architecture is determined by `process.arch`
907
911
912
+
### devEngines
913
+
914
+
The `devEngines` field aids engineers working on a codebase to all be using the same tooling.
915
+
916
+
You can specify a `devEngines` property in your `package.json` which will run before `install`, `ci`, and `run` commands.
917
+
918
+
> Note: `engines` and `devEngines` differ in object shape. They also function very differently. `engines` is designed to alert the user when a dependency uses a differening npm or node version that the project it's being used in, whereas `devEngines` is used to alert people interacting with the source code of a project.
919
+
920
+
The supported keys under the `devEngines` property are `cpu`, `os`, `libc`, `runtime`, and `packageManager`. Each property can be an object or an array of objects. Objects must contain `name`, and optionally can specify `version`, and `onFail`. `onFail` can be `warn`, `error`, or `ignore`, and if left undefined is of the same value as `error`. `npm` will assume that you're running with `node`. Here's an example of a project that will fail if the environment is not `node` and `npm`. If you set`runtime.name` or `packageManager.name` to any other string, it will fail within the npm CLI.
921
+
922
+
```json
923
+
{
924
+
"devEngines": {
925
+
"runtime": {
926
+
"name": "node",
927
+
"onFail": "error"
928
+
},
929
+
"packageManager": {
930
+
"name": "npm",
931
+
"onFail": "error"
932
+
}
933
+
}
934
+
}
935
+
```
936
+
908
937
### private
909
938
910
939
If you set`"private": true`in your package.json, then npm will refuse to publish it.
-[`6ca609e`](https://github.com/npm/cli/commit/6ca609e20b68fb2e5ef8177db116b84a339461fd)[#7789](https://github.com/npm/cli/pull/7789) ping and doctor commands fix for checking if registry is online (#7789) (@milaninfy)
27
+
28
+
### Documentation
29
+
30
+
-[`63d6a73`](https://github.com/npm/cli/commit/63d6a732c3c0e9c19fd4d147eaa5cc27c29b168d)[#7783](https://github.com/npm/cli/pull/7783) package.json: add brief section on exports, link to Node.js docs (#7783) (@wheresrhys)
31
+
-[`366c07e`](https://github.com/npm/cli/commit/366c07e2f3cb9d1c6ddbd03e624a4d73fbd2676e)[#7776](https://github.com/npm/cli/pull/7776) remove incorrect note about npm install (#7776) (@wraithgar)
-[`949d8f8`](https://github.com/npm/cli/commit/949d8f872d341590d17613203bb57b95084b390d)[#7803](https://github.com/npm/cli/pull/7803) engine ^18.17.0 || >=20.5.0 in package template (@reggi)
85
+
-[`fefd509`](https://github.com/npm/cli/commit/fefd509992a05c2dfddbe7bc46931c42f1da69d7)[#7764](https://github.com/npm/cli/pull/7764) deps: bump actions/download-artifact from 3 to 4 in /.github/workflows (#7764) (@dependabot[bot], @wraithgar)
0 commit comments