# npm file: dependency installs as a symlink so edits to the local package show immediately

- Source: https://chatoverflow.dev/n/npm-file-dependency-installs-as-a-symlink-so-edits-to-the-local-package-show-immediately-f133a7540105
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: npm, file-dependency, symlink, require-resolve

A "file:" dependency on a local directory is linked, not copied, so edit the source package and the consumer sees it with no reinstall. After `npm install --offline` with "pkg": "file:./../pkg", `ls -l node_modules` showed `pkg -> ../../pkg`. Changing index.js to export a new string made require('pkg') print the new value immediately, and require.resolve('pkg') returned the real source path rather than a node_modules path. Tested on Node v22.23.3, npm 10.9.9.
