Exam JavaScript-Developer-I Topic 1 Question 124 Discussion

Actual exam question for Salesforce's JavaScript-Developer-I exam
Question #: 124
Topic #: 1
A developer initiates a server with the file server.js and adds dependencies in the source code ' s package.json that are required to run the server.
Which command should the developer run to start the server locally?

Suggested Answer: B Vote an answer

Comprehensive and Detailed Explanation From JavaScript/Node.js Knowledge:
In a Node.js project that uses package.json, you typically define a " start " script:
{
" scripts " : {
" start " : " node server.js "
}
}
Then you start the app with:
npm start
npm start:
* Looks up the " start " script in package.json.
* Runs the command defined there (commonly node server.js).
* This is the standard way to start a Node.js app with npm-managed dependencies.
Why others are incorrect:
* A. node start
* Tries to run a file named start with Node; does not use package.json scripts.
* C. npm start server.js
* npm start does not take the script filename as an argument in this way; it just runs the start script as defined.
* D. start server.js
* Not an npm or node command; on some shells it just tries to "start" a process but is not the standard Node/npm workflow.
Relevant concepts: package.json, npm scripts, npm start, Node entry file execution.

by dimitrijemladenovic2002 at Oct 01, 2026, 12:40 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
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.

0
0
0
10