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: README.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Resolve, fetch, cache, and link npm packages directly from Mix.
11
11
12
12
```elixir
13
13
defdepsdo
14
-
[{:npm, "~> 0.4.0"}]
14
+
[{:npm, "~> 0.6.1"}]
15
15
end
16
16
```
17
17
@@ -107,6 +107,12 @@ mix npm.config
107
107
9. Warns about unmet peer dependencies and deprecated packages
108
108
10. Retries failed downloads with exponential backoff
109
109
110
+
## Supply-chain safety
111
+
112
+
`npm_ex` does not run package lifecycle hooks automatically. Packages with `preinstall`, `install`, `postinstall`, or `prepare` scripts are still installed, but their hooks are ignored and reported as warnings. Tarball paths are also validated before extraction so package contents cannot escape the cache directory.
113
+
114
+
This blocks install-time credential stealers that rely on postinstall hooks reading files like `.env` and exfiltrating them during dependency installation.
115
+
110
116
## Why `npm.lock` instead of `package-lock.json`?
111
117
112
118
`npm_ex` is not npm, so it keeps its own lockfile. `package.json` is the shared manifest; `npm.lock` is the reproducibility file for the `npm_ex` installer.
0 commit comments