Or for example make it a lot smoother to get the build running on any Continuous Integration server. If no node is found, it automatically uses nvm to install the latest 0.10.x version of Node.js to the user’s temp directory.ĭoing this can be good for when you want to use some npm module in your build, for example Component package manager, Yeoman, Grunt or Bower, and you don’t want to bother your colleagues in the team and force them to install Node.js. The script runs very quickly if you already have node on your path, or if the script has run before. ![]() Now you will have access to node and npm inside the Makefile, and can use them just like normal. Then download the find-node-or-install script to the same directory: $ curl -o find-node-or-install PATH := $(NODE_PATH):$(shell echo $$PATH) Put this at the top of your Makefile: SHELL := /bin/bash (I’m planning to work around the requirements for curl and git, so those won’t even be needed in the future.) ![]() About the only things needed are make, bash, curl and git, which are usually available on all development / CI machines. ![]() This is how you can detect existing Node.js and npm, or automatically install a temporary Node.js if none is already installed.
0 Comments
Leave a Reply. |