Courseiva
hardMultiple ChoiceObjective-mapped

200-901 Practice Question: Refer to the exhibit

Exhibit

Refer to the exhibit.
```
Error: EACCES: permission denied, mkdir '/usr/src/app/node_modules/.cache'
    at Object.mkdirSync (fs.js:753:3)
    at ...
```

Refer to the exhibit. A developer is building a Docker image for a Node.js application. The Dockerfile contains: ``` FROM node:14 WORKDIR /usr/src/app COPY package*.json ./ RUN npm install COPY . . CMD ["node", "app.js"] ``` When building, the error shown occurs. What is the most likely cause?

⚠ Common exam trap

Cisco often tests the misconception that npm install always requires root privileges, when in fact the official Node.js image deliberately runs as a non-root user and the fix is to adjust directory ownership, not to escalate privileges.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

The application is running as a non-root user (e.g., node) that lacks write permission to the working directory.

The error occurs because the official Node.js Docker image (node:14) runs as a non-root user named 'node' by default. The WORKDIR /usr/src/app is owned by root, so the 'node' user lacks write permission to that directory. When npm install tries to create node_modules or write package-lock.json, it fails with a permission error. Option D correctly identifies this user-permission mismatch.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The Dockerfile should use the root user for running npm install.

    Why it's wrong here

    Running as root is a security risk; the issue is about file permissions, not user.

  • The npm install command should be run with the --unsafe-perm flag.

    Why it's wrong here

    The --unsafe-perm flag allows npm to run as root, but that is not the recommended solution; the proper fix is to set directory permissions.

  • The base image node:14 is outdated and contains a bug.

    Why it's wrong here

    The error is permission-related, not a bug in the base image.

  • The application is running as a non-root user (e.g., node) that lacks write permission to the working directory.

    Why this is correct

    The node image often uses the node user; if the WORKDIR is owned by root, the node user cannot write to it. The fix is to ensure proper ownership.

About these practice questions

Courseiva writes every 200-901 question from scratch — 989 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This 200-901 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 200-901 exam.