How do I use a local version of a module in node.js
. For example, in my app, I installed coffee-script:
npm install coffee-script
Use npm run[-script]
After using npm to install the bin package to your local ./node_modules
directory, modify package.json
to add like this:
$ npm install --save learnyounode
$ edit packages.json
>>> in packages.json
...
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"learnyounode": "learnyounode"
},
...
$ npm run learnyounode
It would be nice if npm install had a --add-script option or something or if npm run would work without adding to the scripts block.