Skip to content

Commit fcfe9a6

Browse files
authored
Always use --ignore-scripts when installing npm dependencies (#84)
1 parent 6e64ac9 commit fcfe9a6

File tree

7 files changed

+10
-8
lines changed

7 files changed

+10
-8
lines changed

.github/workflows/code-quality.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
node-version-file: .nvmrc
2929
- name: Install dependencies
3030
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
31-
run: npm ci
31+
run: npm ci --ignore-scripts
3232

3333
eslint:
3434
needs: setup
@@ -48,7 +48,7 @@ jobs:
4848
node-version-file: .nvmrc
4949
- name: Install dependencies
5050
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
51-
run: npm ci
51+
run: npm ci --ignore-scripts
5252

5353
- name: Run ESLint
5454
run: npm run lint -- --max-warnings=0
@@ -71,7 +71,7 @@ jobs:
7171
node-version-file: .nvmrc
7272
- name: Install dependencies
7373
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
74-
run: npm ci
74+
run: npm ci --ignore-scripts
7575

7676
- name: Run npm audit with moderate threshold
7777
run: npm audit --audit-level=moderate
@@ -94,7 +94,7 @@ jobs:
9494
node-version-file: .nvmrc
9595
- name: Install dependencies
9696
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
97-
run: npm ci
97+
run: npm ci --ignore-scripts
9898

9999
- name: Run tests with coverage
100100
run: npm run test -- --coverage --silent --maxWorkers=1

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ignore-scripts=true

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ WORKDIR /app
88
COPY package*.json ./
99

1010
# Install dependencies
11-
RUN npm ci --omit=dev
11+
RUN npm ci --ignore-scripts --omit=dev
1212

1313
# Copy source code
1414
COPY . .

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Before you can run the application, you need to set up a MongoDB database.
6161
2. Install the latest version of Node.js v20 with `nvm install 20` and switch to it with `nvm use 20`.
6262
3. Check Node JS is ready with the right version using `node --version`.
6363
4. Copy the example environment file with `cp .env.example .env` and fill out your environment variables (including the MongoDB connection string from above; [see below](#environment-variables) for details).
64-
5. Run `npm install` to install the dependencies.
64+
5. Run `npm install --ignore-scripts` to install the dependencies safely.
6565
6. Run the application with `npm run start` and visit <http://localhost:3001>.
6666

6767
### Environment variables

data/zip-download/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ignore-scripts=true

data/zip-download/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ This is a ZIP download of your prototype that you can run locally within an Expr
66
2. Install the latest version of Node.js v20 with `nvm install 20` and switch to it with `nvm use 20`.
77
3. Check Node JS is ready with the right version with `node --version`.
88
4. Download and extract the ZIP file, and open a terminal window within the extracted folder.
9-
5. Run `npm install` to install the project dependencies.
9+
5. Run `npm install --ignore-scripts` to install the project dependencies safely.
1010
6. Run `npm run start` to run the project.
1111
7. Visit <http://localhost:3000/your-prototype/start> to test the prototype.

docs/help/test-a-prototype.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ The Nunjucks template files and associated files can also be downloaded in a ZIP
1212
2. Install the latest version of Node.js v20 with `nvm install 20` and switch to it with `nvm use 20`.
1313
3. Check Node JS is ready with the right version with `node --version`.
1414
4. Download and extract the ZIP file, and open a terminal window within the extracted folder.
15-
5. Run `npm install` to install the project dependencies.
15+
5. Run `npm install --ignore-scripts` to install the project dependencies safely.
1616
6. Run `npm run start` to run the project.
1717
7. Visit <http://localhost:3000/your-prototype/start> to test the prototype, replacing `your-prototype` with your ZIP download name.

0 commit comments

Comments
 (0)