From 8f5da558b13e03b3d4194d17399097ceffceb76f Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Fri, 29 Mar 2024 00:05:54 +0100 Subject: [PATCH] chore(kb/npm): add example for clean install --- knowledge base/npm.md | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/knowledge base/npm.md b/knowledge base/npm.md index 74dc6a2..6c2d46f 100644 --- a/knowledge base/npm.md +++ b/knowledge base/npm.md @@ -7,19 +7,28 @@ ## TL;DR +```sh +# Install packages. +# Use existing cache. +npm install '@pnp/cli-microsoft365' +npm i -g '@pnp/cli-microsoft365@latest' + +# Install packages invalidating the current cache. +# Removes any existing 'node_modules'. +# Good for CI. +npm clean-install '@pnp/cli-microsoft365' +npm ci -g '@pnp/cli-microsoft365@latest' + +# Remove packages. +npm uninstall '@pnp/cli-microsoft365' +``` + ```sh # Disable SSL verification. npm config set 'strict-ssl'='false' # Use a custom CA certificate. npm config set 'cafile'='path/to/ca/cert.pem' - -# Install packages. -npm install '@pnp/cli-microsoft365' -npm install -g '@pnp/cli-microsoft365@latest' - -# Remove packages. -npm uninstall '@pnp/cli-microsoft365' ``` ## Further readings