https://github.com/ksxgithub/pnpm-issue-0
This is for a feature request
https://github.com/ksxgithub/pnpm-issue-0
feature-request issue pnpm
Last synced: about 1 year ago
JSON representation
This is for a feature request
- Host: GitHub
- URL: https://github.com/ksxgithub/pnpm-issue-0
- Owner: KSXGitHub
- Created: 2018-09-04T11:16:38.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-04T11:27:46.000Z (almost 8 years ago)
- Last Synced: 2025-02-06T11:54:11.342Z (over 1 year ago)
- Topics: feature-request, issue, pnpm
- Language: JavaScript
- Homepage: https://github.com/pnpm/pnpm/issues/1358
- Size: 5.86 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PNPM should prioritize linking local (private) packages in repo instead of installing external packages
## Steps to reproduce
1. Clone this repo.
2. Run `pnpm recursive install`.
3. Run `node index.js`.
## Expected behavior
After step 2, `pnpm` should link `/tools/foo` to `/tools/bar/node_modules`.
After step 3, `/index.js` should calls `/tools/bar/index.js` which in turn calls `/tools/foo/index.js` which prints `'foo'`.
## Actual behavior
After step 2, `pnpm` installs an actual [`foo` package](https://www.npmjs.com/package/foo) from npm registry which is not what I needed.
## Other details
Repo Overview
* This is a multi-packages repo.
* Directory [`/tools`] contains packages that are used as tools in dev environment (e.g. to assist testing, or to validate packages before publishing, etc.) and therefore have `"private": true` in their `package.json`.
* Package `/tools/bar` depends on `foo` (`/tools/foo`).
**Folder structure:**
```
.
├── index.js
├── pnpm-workspace.yaml
├── README.md
└── tools
├── bar
│ ├── index.js
│ └── package.json
└── foo
├── index.js
└── package.json
```
Why do I want this?
* It is nicer to call package by their names instead of write out full paths to their files.
* It allows me to isolate their dependencies from production packages' dependencies.
* It makes it easier for me to know whether a dependency is still neccessary.
Why don't I just rename to package or increase version to really high?
* It doesn't work in a long term.