{"id":16222128,"url":"https://github.com/hugodf/pnpm-node-version-management-corepack","last_synced_at":"2025-07-17T03:06:23.604Z","repository":{"id":232702257,"uuid":"612696595","full_name":"HugoDF/pnpm-node-version-management-corepack","owner":"HugoDF","description":"Using pnpm and corepack to manage both Node.js and pnpm versions.","archived":false,"fork":false,"pushed_at":"2023-03-11T17:55:56.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-14T01:39:16.021Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HugoDF.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-03-11T17:55:50.000Z","updated_at":"2023-03-11T17:55:59.000Z","dependencies_parsed_at":"2024-04-11T02:42:45.103Z","dependency_job_id":"4c9aac5c-a90c-4c0f-a85a-e731c05d05c9","html_url":"https://github.com/HugoDF/pnpm-node-version-management-corepack","commit_stats":null,"previous_names":["hugodf/pnpm-node-version-management-corepack"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HugoDF%2Fpnpm-node-version-management-corepack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HugoDF%2Fpnpm-node-version-management-corepack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HugoDF%2Fpnpm-node-version-management-corepack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HugoDF%2Fpnpm-node-version-management-corepack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HugoDF","download_url":"https://codeload.github.com/HugoDF/pnpm-node-version-management-corepack/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247755588,"owners_count":20990626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T12:11:20.041Z","updated_at":"2025-04-08T00:46:43.985Z","avatar_url":"https://github.com/HugoDF.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node.js version management with pnpm and pnpm version management with corepack\n\nUsing pnpm and corepack to manage both Node.js and pnpm versions.\n\n## Goals\n\n1. ensure right Node.js version is used\n2. ensure right package manager \u0026 package manager version is used, ie. if we use pnpm it should disallow use of yarn/npm and the version of pnpm used should be correct\n\n## Approach\n\n1. `use-node-version=18.15.0` in `.npmrc` to pin the Node.js version pnpm will use when invoked\n2. `preinstall` script that enables corepack\n   - problem: `npm i` still works\n   - [failed] `corepack enable npm yarn pnpm`, would overwrite `npm`, `yarn` and `pnpm` with symlinks/shims, this would be useful so that `npm ...` and `yarn ...` get intercepted and error with `Usage Error: This project is configured to use pnpm`\n     - however it looks like this only works on second run, the first `npm i` will work fine, the second will fail with the right error, so we need to find an alternative\n   - lint rule using [check-file/filename-blocklist](https://github.com/DukeLuo/eslint-plugin-check-file/blob/main/docs/rules/filename-blocklist.md) and eslint-plugin-json (in order to lint JSON files) that disallows `package-lock.json` in favour of a `pnpm-lock.yaml`\n     - Rule:\n       ```js\n        'check-file/filename-blocklist': [\n            'error',\n            {\n                '{,}package-lock.json': '*pnpm-lock.yaml',\n            },\n        ],\n       ```\n     - ESLint invocation: `eslint . --ext js,json`\n     - Error output:\n       ```sh\n       1:2  error  The filename \"package-lock.json\" matches the blocklisted \"{,}package-lock.json\" pattern. Use a pattern like \"*pnpm-lock.yaml\" instead  check-file/filename-blocklist\n       ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugodf%2Fpnpm-node-version-management-corepack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhugodf%2Fpnpm-node-version-management-corepack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugodf%2Fpnpm-node-version-management-corepack/lists"}