In the closing section of this chapter, we'll turn our attention to writing Lo-Dash code for the backend. This of course means installing Lo-Dash as a Node.js package.
Assuming you already have Node installed, since you had to do so in order to run the grunt
command in the RequireJS examples, you should have an npm
command on your system. If that's the case, installation is incredibly easy:
npm install -g lodash
This will install Lo-Dash globally, meaning it's accessible to any other Node project that wishes to use it. This is probably a good idea since Lo-Dash is a library after all. To verify that the installation was a success, you can run the following command:
node -e "require('lodash');"
If you see a long error message, it means that something went wrong at the time of installation. If it exists silently, you're all set.