Wednesday, July 02, 2014

fixing "npm install jshint" error on #chef #nodejs

Error output:
npm ERR! Error: No compatible version found: date-now@'^0.1.4'
npm ERR! Valid install targets:
npm ERR! ["0.1.0","0.1.1","0.1.3","0.1.2","0.1.4","1.0.0"]


If you get the above error while installing/updating your test servers with #chef, you will need to update the version of npm that is installed on your machine. (ref: https://github.com/npm/npm/issues/5298)

I use the nodejs chef cookbook (http://community.opscode.com/cookbooks/nodejs) to install npm, so updating the npm install version variable to 1.4.19 worked like a charm.

File: /cookbooks/nodejs/attributes/default.rb
Change: default['nodejs']['npm'] = '1.4.19'

While reading through the source I noticed that this cookbook isn't using the install script provided by npmjs site(https://www.npmjs.org/doc/README.html) for installing npm. sounds like an opportunity for any #chef lover to contribute and update the cookbook.

No comments: