> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# package-script-remote-code

> A package.json install lifecycle script downloads code and runs it, for example `curl ... | sh`.

## What it flags

A `package.json` install lifecycle script (`preinstall`, `install`, `postinstall`, `preprepare`, `prepare`, `postprepare`), or a script it starts with `npm run`, `pnpm`, `yarn` or `bun run`, that downloads code and runs it in the same step: `curl ... | sh`, `wget -qO- ... | sudo bash`, `curl ... |& bash`, `curl ... | tee setup.sh | sh`, `iwr ... | iex`, `node -e "$(curl ...)"`, `eval "$(curl ...)"` and `bash <(curl ...)`. The code runs on every machine that installs the project, with no checksum or pinned version, so whoever controls the URL or the network path controls those machines. [npm docs: scripts](https://docs.npmjs.com/cli/using-npm/scripts)

Not reported: downloads saved to a file (`curl -o`, `-O`, a `>` redirect, or `wget` without `-O-`), data piped into a script file (`curl ... | node print.js`) or an archive tool, commands that only `echo` or `printf` the text, unless their output is piped or redirected, and scripts that do not run on install.

```json theme={null}
"postinstall": "node scripts/install-binary.js"
```

No automatic fix: a human decides.

## Configuration

Set the rule to `"off"` in `loadwise.config.json` to drop its findings:

```json theme={null}
{
  "rules": { "package-script-remote-code": "off" }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.