Node.js · Junior · Question 20 of 75

Where does require("lodash") look for the package?

Explanation

Node.js walks up the directory tree looking in each node_modules. Packages installed with -g are not found by require() by default.

Further reading

Problem with a question

Node.js · Junior · question 20

Test yourself

Take the Node.js · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz