diff --git a/src/components/patterns/Hero/Hero.astro b/src/components/patterns/Hero/Hero.astro index 0a2374a68f..67c3bf633f 100644 --- a/src/components/patterns/Hero/Hero.astro +++ b/src/components/patterns/Hero/Hero.astro @@ -12,8 +12,8 @@ const t = useTranslations(lang); const expressPackage = await getEntry('npm', 'express'); const EXPRESS_VERSION = expressPackage?.data.version ?? '5.x'; -const INSTALL_COMMAND = 'npm install express --save'; -const EXAMPLE_CODE = `const express = require('express') +const INSTALL_COMMAND = 'npm install express'; +const EXAMPLE_CODE = `const express = require('express'); const app = express() const port = 3000 diff --git a/src/content/docs/en/5x/starter/installing.mdx b/src/content/docs/en/5x/starter/installing.mdx index f6dc8220d4..0bae20f479 100755 --- a/src/content/docs/en/5x/starter/installing.mdx +++ b/src/content/docs/en/5x/starter/installing.mdx @@ -39,3 +39,9 @@ To install Express temporarily and not add it to the dependencies list: ```bash npm install express --no-save ``` + + + For npm version 5.0.0 and above, npm install express automatically adds the package + to your dependencies. Explicit use of the --save flag is optional and + mainly kept for reference purposes. + diff --git a/tests/e2e/homepage.spec.ts b/tests/e2e/homepage.spec.ts index 0b31eed779..38eb280304 100644 --- a/tests/e2e/homepage.spec.ts +++ b/tests/e2e/homepage.spec.ts @@ -133,7 +133,7 @@ test.describe('Homepage Content', () => { test('should display the installation command', async ({ page }) => { const installCode = page.getByTestId('install-command'); await expect(installCode).toBeVisible(); - await expect(installCode).toContainText(/npm install express --save/i); + await expect(installCode).toContainText(/npm install express/i); }); test('should have a working "Get Started" call to action', async ({ page }) => {