exam questions

Exam AZ-400 All Questions

View all questions & answers for the AZ-400 exam

Exam AZ-400 topic 1 question 15 discussion

Actual exam question from Microsoft's AZ-400
Question #: 15
Topic #: 1
[All AZ-400 Questions]

You scan a Node.js application using WhiteSource Bolt.
The scan finds numerous libraries with invalid licenses, but are only used during development.
You have to make sure that only production dependencies are scanned by WhiteSource Bolt.
Which of the following is a command you should run?

  • A. npm edit
  • B. npm publish
  • C. npm install
  • D. npm update
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
jojom19980
Highly Voted 10 months, 1 week ago
The npm install command will install the devDependencies along other dependencies when run inside a package directory, in a development environment (the default). Use npm install --only=prod (or --only=production) to install only dependencies, and not devDependencies,regardless of the value of the NODE_ENV environment variable. https://stackoverflow.com/questions/9268259/how-do-you-prevent-install-of-devdependencies-npm-modules-for-node-js-package
upvoted 43 times
Sant25
3 years, 10 months ago
GIVEN ANS CORRECT npm install will install both "dependencies" and "devDependencies" npm install --production will only install "dependencies" npm install --dev will only install "devDependencies"
upvoted 12 times
...
...
somenick
Highly Voted 2 years, 5 months ago
Just FYI WhiteSource Bolt is now Mend Bolt
upvoted 11 times
...
heyhuryu
Most Recent 9 months, 1 week ago
The correct answer is: C. npm install To ensure that only production dependencies are scanned by WhiteSource Bolt, you should install only the production dependencies of your Node.js application. This can be done by running: npm install --only=production This command installs only the dependencies listed under "dependencies" in your package.json file, skipping those listed under "devDependencies", which are only used during development. A. npm edit: Opens a package’s package.json in the default text editor; it does not install or update dependencies. B. npm publish: Publishes the package to the npm registry, making it publicly available; it does not affect dependency installation. D. npm update: Updates installed dependencies but does not limit them to production-only. Therefore, C. npm install --only=production is the command to run.
upvoted 2 times
...
FeriAZ
10 months, 1 week ago
Selected Answer: C
WhiteSource Bolt: Scans your application for vulnerabilities, including those in libraries with invalid licenses. Scenario: You want to scan only production dependencies, excluding development libraries identified by WhiteSource Bolt. Correct Command: npm install --only=production (or --only=prod)
upvoted 2 times
...
yana_b
1 year, 11 months ago
Selected Answer: C
Correct answer is npm install
upvoted 1 times
...
PravinDhote
2 years, 7 months ago
Selected Answer: C
C is correct
upvoted 1 times
...
SOMINAZURE
2 years, 8 months ago
C is correct answer.
upvoted 1 times
...
syu31svc
2 years, 12 months ago
Selected Answer: C
C to me You have to install it so that WhiteSource can scan right?
upvoted 2 times
...
Govcomm
3 years ago
Correct, npm install -production.
upvoted 1 times
...
Eltooth
3 years, 2 months ago
Selected Answer: C
C is correct answer.
upvoted 3 times
...
rdemontis
3 years, 4 months ago
Selected Answer: C
correct https://docs.npmjs.com/cli/v8/commands/npm-install
upvoted 5 times
...
AlMargoi
3 years, 8 months ago
Correct
upvoted 2 times
...
Aamir1234
4 years ago
correct !
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...