From 37ee6e39b00f33088911197e527ddfafb808bccf Mon Sep 17 00:00:00 2001 From: Rahul <122141535+rahulio96@users.noreply.github.com> Date: Thu, 13 Jul 2023 22:07:45 +0000 Subject: [PATCH 1/5] Added steps for using npm/npx locally --- CONTRIBUTING.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e12e300210841..b657e44fa1ecf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,6 +48,34 @@ We use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). We use [`tap`](https://node-tap.org/) for testing & expect that every new feature or bug fix comes with corresponding tests that validate the solutions. Tap also reports on code coverage and it will fail if that drops below 100%. +## Run npm/npx Locally + +If a specific command is not covered by tap, try the following: + +To run your repository's version of the npm cli on your local machine use the following commands: + +**npm commands:** +```bash +alias localnpm="node /filepath/npm" +``` + +**npx commands:** +```bash +alias localnpx="node /filepath/npm/bin/npx-cli.js" +``` + +After running the above commands, use localnpx and localnpm instead of npx and npm respectively. + +For example instead of: +```bash +npx --no-install esbuild +``` +Use: +```bash +localnpx --no-install esbuild +``` + + ## Performance & Benchmarks We've set up an automated [benchmark](https://github.com/npm/benchmarks) integration that will run against all Pull Requests; Posting back a comment with the results of the run. From 37bcb304c1f9fb7ed0b25ae6d97145f4b2ee8331 Mon Sep 17 00:00:00 2001 From: AaronHamilton965 <91709196+AaronHamilton965@users.noreply.github.com> Date: Mon, 17 Jul 2023 18:38:46 +0000 Subject: [PATCH 2/5] revised npm/npx locally section replacing alias with node . --- CONTRIBUTING.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b657e44fa1ecf..ba2395f5c97dc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,23 +56,21 @@ To run your repository's version of the npm cli on your local machine use the fo **npm commands:** ```bash -alias localnpm="node /filepath/npm" +node . ``` **npx commands:** ```bash -alias localnpx="node /filepath/npm/bin/npx-cli.js" +node . exec ``` -After running the above commands, use localnpx and localnpm instead of npx and npm respectively. - For example instead of: ```bash -npx --no-install esbuild +npm install esbuild ``` Use: ```bash -localnpx --no-install esbuild +node . install esbuild ``` From 3f5ad2d31dffd84e4012c4b4d169c272f99835a3 Mon Sep 17 00:00:00 2001 From: Rahul <122141535+rahulio96@users.noreply.github.com> Date: Mon, 17 Jul 2023 18:52:32 +0000 Subject: [PATCH 3/5] Changed the examples to npm exec instead of npm install --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ba2395f5c97dc..055259128f9cf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -66,11 +66,11 @@ node . exec For example instead of: ```bash -npm install esbuild +npm exec --yes false -- esbuild ``` Use: ```bash -node . install esbuild +node . exec --yes false -- esbuild ``` From 062babb5f46442c76d2b5e27f9c4cfe58e702ea0 Mon Sep 17 00:00:00 2001 From: Rahul <122141535+rahulio96@users.noreply.github.com> Date: Mon, 17 Jul 2023 21:19:57 +0000 Subject: [PATCH 4/5] Made example commands broader --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 055259128f9cf..fefc10aaaf0d6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -66,11 +66,11 @@ node . exec For example instead of: ```bash -npm exec --yes false -- esbuild +npm exec -- ``` Use: ```bash -node . exec --yes false -- esbuild +node . exec -- ``` From 7b92e7688ba652411a23da76a3869f18e7d1800d Mon Sep 17 00:00:00 2001 From: Rahul <122141535+rahulio96@users.noreply.github.com> Date: Mon, 17 Jul 2023 21:34:23 +0000 Subject: [PATCH 5/5] Removed Run npm/npx Locally header --- CONTRIBUTING.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fefc10aaaf0d6..eb2beb45f1e8a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,10 +48,6 @@ We use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). We use [`tap`](https://node-tap.org/) for testing & expect that every new feature or bug fix comes with corresponding tests that validate the solutions. Tap also reports on code coverage and it will fail if that drops below 100%. -## Run npm/npx Locally - -If a specific command is not covered by tap, try the following: - To run your repository's version of the npm cli on your local machine use the following commands: **npm commands:**