Bird
0
0

You wrote this Dockerfile line:

medium📝 Debug Q6 of 15
Remix - Deployment
You wrote this Dockerfile line:
RUN npm install

but the build fails with 'npm: command not found'. What is the likely cause?
AThe RUN command syntax is incorrect.
BThe base image does not have Node.js and npm installed.
Cnpm install should be run outside the Dockerfile.
DThe WORKDIR was not set before RUN.
Step-by-Step Solution
Solution:
  1. Step 1: Understand error meaning

    'npm: command not found' means npm is missing in the container environment.
  2. Step 2: Check base image

    If base image lacks Node.js/npm, RUN npm install fails; syntax and WORKDIR do not cause this error.
  3. Final Answer:

    The base image does not have Node.js and npm installed. -> Option B
  4. Quick Check:

    npm missing = base image lacks Node.js [OK]
Quick Trick: Use node-based image to have npm available [OK]
Common Mistakes:
MISTAKES
  • Blaming RUN syntax for missing npm
  • Thinking npm install can't run in Dockerfile
  • Assuming WORKDIR causes npm errors

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Remix Quizzes