Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

Error: Cannot find module 'grunt-legacy-util' #1165

Closed
pezholio opened this issue Mar 20, 2014 · 8 comments
Closed

Error: Cannot find module 'grunt-legacy-util' #1165

pezholio opened this issue Mar 20, 2014 · 8 comments
Labels

Comments

@pezholio
Copy link

I've just tried to build fine-uploader, but after following the instructions, I get to grunt package and I get the following error:

module.js:340
    throw err;
          ^
Error: Cannot find module 'grunt-legacy-util'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/Users/stuart/Documents/fine-uploader/node_modules/grunt/lib/grunt.js:26:12)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/grunt-cli/bin/grunt:45:1)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain (module.js:492:10)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)

I've tried installing grunt-legacy-util, but I still get the same error. Any ideas where I'm going wrong?

@feltnerm
Copy link
Contributor

Hmm... I just blew away my node_modules and ran npm i and grunt package and I did not experience this.

I'm running:

% grunt --version                                                                                                                                                                                                                                                            
grunt-cli v0.1.13
grunt v0.4.4

What version of grunt are you on? I think they've had API changes recently.
grunt --version

@rnicholus
Copy link
Member

No response for 2 days, closing. This can be re-opened in the future if new information is included.

@crowjonah
Copy link

I'm not sure why this started happening to me, too, but running sudo npm install -g grunt-legacy-util fixed it for me, just in case anyone else is having this issue!

@beersy001
Copy link

npm update fixed it for me

@stefan-lz
Copy link

👍 npm update did the trick

@cfalguiere
Copy link

I got the same error when grunt is run from a project created with yeoman (yo angular and code lab options) and the app folder is under /vagrant.

It disappeared after a yo update (npm update -g yo) and the creation of a new project, even in /vagrant.

vagrant@dev:~$ grunt --version
grunt-cli v0.1.13
==> OK

vagrant@dev:~$ cd /vagrant/
vagrant@dev:/vagrant$ grunt --version
grunt-cli v0.1.13
==> KO

vagrant@dev:~/mytodolocal$ grunt --version
grunt-cli v0.1.13
==> OK

vagrant@dev:/vagrant$ cd mytodo/
vagrant@dev:/vagrant/mytodo$ grunt --version
grunt-cli v0.1.13

module.js:340
throw err;
^

vagrant@dev:/vnpm update -g yo
vagrant@dev:/vagrant/mytodo2$ grunt --version
grunt-cli v0.1.13
=> OK

Full log of grunt --version ran within the project

module.js:340
throw err;
^
Error: Cannot find module 'grunt-legacy-util'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/vagrant/mytodo/node_modules/grunt/lib/grunt.js:26:12)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/usr/local/lib/node_modules/grunt-cli/bin/grunt:45:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
==> Failed

Here is the installation process I ran before
--- installation process
#provisioning shell ran from vagrant on an ubuntu/trusty64 box
sudo apt-get update
sudo locale-gen en_US.UTF-8
sudo locale-gen fr_FR.UTF-8
sudo apt-get -y install git
sudo apt-get -y install nodejs
sudo apt-get install nodejs-legacy # required on ubuntu to be able to run npm install
sudo apt-get -y install npm
npm update
sudo npm install -g yo bower grunt-cli
sudo npm install -g generator-angular

grunt --version works fine in another vm I created from an angular-seed template, even when the commande is run from within a project

@feltnerm
Copy link
Contributor

feltnerm commented Jan 5, 2015

Did you run npm i inside of the project dir? You also need a local grunt.

@JamesVanWaza
Copy link

@feltnerm
I ran npm update but kept getting the error.

@FineUploader FineUploader locked and limited conversation to collaborators Apr 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants