2014-05-20 18 views
37

Ho appena ricevuto una copia di un pacchetto grunt su cui lavorare, ma sono nuovo per grugnire e sto avendo difficoltà a trovare le risposte ad alcune cose. Il problema principale non è sapere da dove provengono gli errori di seguito: qualcuno può dirmi da dove viene? Entrambi questi file si trovano nella stessa directory.grunt - ottenendo "Local Npm module" xxx "non trovato. È installato?" Cosa sta causando questo?

$ grunt 
>> Local Npm module "grunt-contrib-clean" not found. Is it installed? 
>> Local Npm module "grunt-contrib-concat" not found. Is it installed? 
>> Local Npm module "grunt-contrib-copy" not found. Is it installed? 
>> Local Npm module "grunt-contrib-cssmin" not found. Is it installed? 
>> Local Npm module "grunt-contrib-handlebars" not found. Is it installed? 
>> Local Npm module "grunt-contrib-jshint" not found. Is it installed? 
>> Local Npm module "grunt-contrib-qunit" not found. Is it installed? 
>> Local Npm module "grunt-contrib-uglify" not found. Is it installed? 
>> Local Npm module "grunt-preprocess" not found. Is it installed? 
>> Local Npm module "grunt-wrap" not found. Is it installed? 
>> Local Npm module "grunt-debug-task" not found. Is it installed? 
Warning: Task "clean" not found. Use --force to continue. 

Aborted due to warning. 

$ 

E qui è il mio package.json:

{ 
    "name": "baked-widget", 
    "srcDirectory": "./src", 
    "srcJavascript": "./src/js", 
    "srcCss": "./src/css", 
    "srcData": "./src/data", 
    "testDirectory": "./test", 
    "tgtDirectory": "./build", 
    "installDirectory": "../com/public/widgets", 
    "version": "4.2.0", 
    "devDependencies": { 
    "grunt": "~0.4", 
    "grunt-contrib-clean": "~0.4.0", 
    "grunt-contrib-concat": "~0.3.0", 
    "grunt-contrib-copy": "~0.5.0", 
    "grunt-contrib-cssmin": "~0.9.0", 
    "grunt-contrib-handlebars": "~0.6", 
    "grunt-contrib-jshint": "~0.8", 
    "grunt-contrib-uglify": "~0.3", 
    "grunt-contrib-qunit": "~0.4", 
    "grunt-contrib-watch": "~0.5", 
    "grunt-preprocess": "~4.0", 
    "grunt-wrap": "~0.3", 
    "grunt-debug-task": "~0.1.4" 
    } 
} 

risposta

59

Probabilmente non avete installato pacchetti necessari a livello locale. Prova a npm install (sudo npm install) per assicurarti di averlo fatto.

+0

Yeas, è necessario assicurarsi di installare localmente le librerie utilizzate: p – Ethan

+0

ha funzionato per me –

9

Se la risposta accettata non funziona e si dispone di un file corretto package.json, è possibile:

  1. eliminare la cartella node_modules (o copia di backup da qualche parte)

  2. e quindi eseguire npm install

per un nuovo inizio.

Problemi correlati