exam questions

Exam AZ-400 All Questions

View all questions & answers for the AZ-400 exam

Exam AZ-400 topic 7 question 36 discussion

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

You have 50 Node.js-based projects that you scan by using WhiteSource. Each project includes Package.json, Package-lock.json, and Npm-shrinkwrap.json files.
You need to minimize the number of libraries reports by WhiteSource to only the libraries that you explicitly reference.
What should you do?

  • A. Configure the File System Agent plug-in.
  • B. Add a devDependencies section to Package-lock.json.
  • C. Configure the Artifactory plug-in.
  • D. Delete Package-lock.json.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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
klopper
Highly Voted 4 years, 5 months ago
Is it a typo? There is no devDependencies in the package-lock.json. The given comment refers to the devDependencies section in package.json
upvoted 26 times
Radul85
1 year, 9 months ago
Correttamundo !
upvoted 1 times
...
chandru1dev
3 years, 3 months ago
It's a typo. In the comments, it's mentioned correctly
upvoted 3 times
...
...
somedude
Highly Voted 4 years, 4 months ago
Yeah, probably a typo. Here's a link to article describing similar scenario with WhiteSource: https://docs.microsoft.com/en-us/archive/blogs/visualstudioalmrangers/manage-your-open-source-usage-and-security-as-reported-by-your-cicd-pipeline
upvoted 7 times
jasifu3
2 years, 7 months ago
according to your link, "whitesource will soon release an npm plugin" for this. The plugin is now released, so I would not be surprised if the question has been updated with the plugin as the correct answer.
upvoted 1 times
...
...
ozbonny
Most Recent 8 months, 1 week ago
Selected Answer: B
B. Add a devDependencies section to Package-lock.json.
upvoted 1 times
...
ObiWan500
11 months, 3 weeks ago
Selected Answer: A
Correct answer is A, not B The File System Agent plug-in is a WhiteSource tool that scans the files and folders of your projects and reports the libraries and licenses that are detected. You can configure the File System Agent plug-in to scan only the Package.json files of your Node.js projects, and ignore the Package-lock.json and Npm-shrinkwrap.json files. This way, you will minimize the number of libraries reported by WhiteSource to only the libraries that you explicitly reference in the Package.json files. B. Adding a devDependencies section to Package-lock.json will not work, because the Package-lock.json file is automatically generated by npm and should not be manually edited. The devDependencies section in Package-lock.json reflects the devDependencies from the Package.json file of the dependency, not the project. Source: Bing AI :)
upvoted 1 times
...
Fal991l
1 year, 6 months ago
GPT: Adding a devDependencies section to the package.json file in order to run npm install --omit-dev is a valid approach for reducing the size of the installed packages and the time it takes to install them, but it is not the correct solution for minimizing the number of libraries reports by WhiteSource to only the libraries that you explicitly reference. The devDependencies section in package.json is used to specify the packages that are only required for development and testing, and not for the production use of the project. By default, the npm install command installs all dependencies, including those specified in devDependencies. However, by running npm install --omit-dev, you can exclude the packages listed in devDependencies from being installed. This can help reduce the size of the installed packages and the time it takes to install them, especially in production environments where only the packages needed for runtime are required.
upvoted 1 times
Fal991l
1 year, 6 months ago
But to minimize the number of libraries reports by WhiteSource to only the libraries that you explicitly reference, you need to delete the npm-shrinkwrap.json and package-lock.json files and only keep the package.json file in each of the 50 Node.js-based projects.
upvoted 1 times
...
...
smariussorin
1 year, 8 months ago
Selected Answer: B
Typo, it should be: " Add a devDependencies section to Package.json." in order to run npm install --omit-dev
upvoted 1 times
...
Schtrudl
2 years, 2 months ago
Selected Answer: B
Correct Answer is B
upvoted 1 times
...
syu31svc
2 years, 2 months ago
Selected Answer: B
https://docs.microsoft.com/en-us/archive/blogs/visualstudioalmrangers/manage-your-open-source-usage-and-security-as-reported-by-your-cicd-pipeline: "Within your package.json file be sure you split out your npm dependencies between devDependencies and (production) dependencies" Answer is B (though like what others before me have pointed out, it's a typo; package.json and not package lock)
upvoted 3 times
...
UnknowMan
2 years, 5 months ago
B. Add a devDependencies section to Package.json. (Not Package-lock.json)
upvoted 2 times
...
rdemontis
2 years, 7 months ago
Selected Answer: B
correct answer but the change has to be made to package.json file
upvoted 2 times
...
fragtom
3 years, 6 months ago
Info for related url https://docs.microsoft.com/en-us/azure/devops/migrate/security-validation-cicd-pipeline?view=azure-devops
upvoted 2 times
...
DeepMoon
3 years, 7 months ago
Why do we need lock files? Lock files are intended to pin down, or lock, all versions for the entire dependency tree at the time that the lock file is created. Why is it important to use a package lock file and lock package versions? Without a package lock file, a package manager such as Yarn or npm will resolve the the most current version of a package in real-time during the dependencies install of a package, rather than the version that was originally intended for the specific package
upvoted 3 times
...
27close
3 years, 12 months ago
answer B-confirm
upvoted 2 times
...
glaedr
4 years, 2 months ago
Answer correct solving the typo error. It should be package.json instead of package-lock.json https://docs.npmjs.com/specifying-dependencies-and-devdependencies-in-a-package-json-file
upvoted 4 times
...
pnkumar
4 years, 4 months ago
According to this https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/javascript?view=azure-devops&tabs=code answer should be package.json
upvoted 5 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago