Welcome to the Linux Foundation Forum!

Is it wrong correct answer in Chapter 6 Quiz?

Hello, I’ve found no correct answer in Packages & Dependencies quiz, question 6.2. As a result system makes Option C as a correct one. By my knowledge and experience, the correct script should contain run for each script execution before script name, like:

npm run lint && npm run test

In other way NPM CLI shows an error: “unknown command…”

Quiz question:

  1. Question 6.2
  2. Given two "scripts" fields in the package.json file named "test" and "lint", which of the following commands would execute both scripts?
  3.  
  4. A. npm test && npm lint
  5. B. npm run test lint
  6. C. npm run lint && npm test (Correct)

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Answers

  • Posts: 160

    @akaiurin - the package.json contains lint and test field, npm run lint runs lint field, npm test runs test field

  • Posts: 8

    @xdxmxc said:
    @akaiurin - the package.json contains lint and test field, npm run lint runs lint field, npm test runs test field

    What do you mean under "field"? Is it script in "scripts"?

  • Posts: 8

    @xdxmxc Oh.. finally, I found paragraph about "test" alias. idk why, but before topic creation, I had tried "test" execution by myself and got an error. Question is solved.

  • Posts: 160

    excellent :+1:

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training