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
If you need to upgrade (or downgrade) the version of npm,
43
+
add the following to your `Dockerfile`, replacing `<version>` with the desired value.
44
+
View the [npm registry listing](https://www.npmjs.com/package/npm?activeTab=versions) for available versions and tags.
45
+
46
+
```Dockerfile
47
+
RUN npm install --global npm@<version>
48
+
```
49
+
30
50
## Global npm dependencies
31
51
32
52
If you need to install global npm dependencies, it is recommended to place those dependencies in the [non-root user](#non-root-user) directory. To achieve this, add the following line to your `Dockerfile`
ENV PATH=$PATH:/home/node/.npm-global/bin # optionally if you want to run npm global bin without specifying path
38
58
```
39
59
60
+
This recommendation does not apply to npm itself, which is installed in `/usr/local/bin/npm`.
61
+
40
62
## Handling Kernel Signals
41
63
42
64
Node.js was not designed to run as PID 1 which leads to unexpected behaviour when running inside of Docker. For example, a Node.js process running as PID 1 will not respond to `SIGINT` (`CTRL-C`) and similar signals. As of Docker 1.13, you can use the `--init` flag to wrap your Node.js process with a [lightweight init system](https://github.com/krallin/tini) that properly handles running as PID 1.
0 commit comments