Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grunt install failure

Tags:

npm

gruntjs

I'm trying to install Grunt using the following command:

npm install -g grunt-cli

I get this result:

npm http GET https://registry.npmjs.org/grunt-cli
npm http 304 https://registry.npmjs.org/grunt-cli
npm ERR! Error: No compatible version found: grunt-cli
npm ERR! No valid targets found.
npm ERR! Perhaps not compatible with your version of node?
npm ERR!     at installTargetsError (/usr/share/npm/lib/cache.js:488:10)
npm ERR!     at next_ (/usr/share/npm/lib/cache.js:438:17)
npm ERR!     at next (/usr/share/npm/lib/cache.js:415:44)
npm ERR!     at /usr/share/npm/lib/cache.js:408:5
npm ERR!     at saved (/usr/share/npm/lib/utils/npm-registry-client/get.js:147:7)
npm ERR!     at Object.oncomplete (/usr/lib/nodejs/graceful-fs.js:230:7)
npm ERR! You may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /root/node/npm-debug.log npm
npm ERR! 
npm ERR! System Linux 3.5.0-17-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "grunt-cli"
npm ERR! cwd /root/node
npm ERR! node -v v0.6.19
npm ERR! npm -v 1.1.4
npm ERR! message No compatible version found: grunt-cli
npm ERR! message No valid targets found.
npm ERR! message Perhaps not compatible with your version of node?
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /root/node/npm-debug.log
npm not ok

Ideas? I know my Node and npm are installed correctly. I am using Ubuntu Linux 12.04 LTS with a standard LAMP installation and npm version v0.11.5-pre

like image 954
MatrixSenpai Avatar asked Jul 22 '13 15:07

MatrixSenpai


People also ask

How do I install grunt?

Like installing a specific version of grunt, run npm install grunt@VERSION --save-dev where VERSION is the version you need, and npm will install that version of Grunt in your project folder, adding it to your package. json devDependencies.

Why npm install is failing?

code 1 error usually occurs when you run the npm install command. This cause of this error is that one of the dependencies you define in your package. json file fails to be installed properly on your computer. This means that npm fails to install the node-sass module that's added as a dependency to the n-app project.

How do I install grunt locally to my project?

Installing grunt-cli locally If you prefer the idiomatic Node. js method to get started with a project ( npm install && npm test ) then install grunt-cli locally with npm install grunt-cli --save-dev . Then add a script to your package. json to run the associated grunt command: "scripts": { "test": "grunt test" } .

Is grunt deprecated?

grunt. util. _ is deprecated and we highly encourage you to npm install lodash and var _ = require('lodash') to use lodash .


3 Answers

You're using an old version of node.js (v0.6.19). Grunt is only compatible with node.js >= 0.8. See this issue for a duplicate problem: https://github.com/gruntjs/grunt/issues/723

like image 69
Kyle Robinson Young Avatar answered Nov 15 '22 15:11

Kyle Robinson Young


Ubuntu

1. Setup with Ubuntu

curl -sL https://deb.nodesource.com/setup | sudo bash -

2. Then install with Ubuntu

sudo apt-get install -y nodejs

Debian

1. Update your Repository

sudo apt-get install curl

  1. Update your source

sudo curl -sL https://deb.nodesource.com/setup | sudo bash -

Source https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager

like image 24
Stephen Kuehl Avatar answered Nov 15 '22 14:11

Stephen Kuehl


Solved by adding export NODE_PATH= Output of "which node" to my .bashrc file

like image 25
MatrixSenpai Avatar answered Nov 15 '22 13:11

MatrixSenpai