Search code examples
node.jschef-infranpm-installchef-recipe

Unable to run packages installed using npm on VM provisioned by Chef


I provisioned my VM on AWS using Chef and installed NodeJS using the NodeJS recipe (https://github.com/redguide/nodejs). When I do a global npm install of any package, I am not able to run that package using command line. Attached the screenshot below.

enter image description here


Solution

  • There are two options:

    1)add the /usr/local/nodejs-binary-6.3.0/bin/ to PATH variable.

    Or

    2)Run /usr/local/nodejs-binary-6.3.0/bin/http-server.

    The npm package binaries are not added to path by default. I would prefer option 2 to keep the path unpolluted