2014-07-11 9 views
14

Ho appena creato un progetto di nodo e sto cercando di installare jquery usando bower.Bower - errore durante l'installazione del pacchetto "Argomenti su path.join deve essere stringhe"

bower install jquery 

ottengo il seguente errore:

bower jquery#*    not-cached git://github.com/jquery/jquery.git#* 
bower jquery#*     resolve git://github.com/jquery/jquery.git#* 
bower jquery#*     error Arguments to path.join must be strings 

Stack trace: 
TypeError: Arguments to path.join must be strings 
    at f (path.js:204:15) 
    at Object.filter (native) 
    at Object.exports.join (path.js:209:40) 
    at GitHubResolver._checkout (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\lib\core\resolvers\GitHubResolver.js:54:21) 
    at C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\lib\core\resolvers\GitResolver.js:69:21 
    at _fulfilled (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\p-throttler\node_modules\q\q.js:798:54) 
    at self.promiseDispatch.done (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\p-throttler\node_modules\q\q.js:827:30) 
    at Promise.promise.promiseDispatch (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\p-throttler\node_modules\q\q.js:760:13) 
    at C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\p-throttler\node_modules\q\q.js:574:44 
    at flush (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\p-throttler\node_modules\q\q.js:108:17) 

Console trace: 
Trace 
    at StandardRenderer.error (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\lib\renderers\StandardRenderer.js:72:17) 
    at Logger.<anonymous> (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\bin\bower:111:22) 
    at Logger.emit (events.js:95:17) 
    at Logger.emit (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\bower-logger\lib\Logger.js:29:39) 
    at C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\lib\commands\index.js:40:20 
    at _rejected (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\q\q.js:797:24) 
    at C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\q\q.js:823:30 
    at Promise.when (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\q\q.js:1035:31) 
    at Promise.promise.promiseDispatch (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\q\q.js:741:41) 
    at C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\q\q.js:557:44 

System info: 
Bower version: 1.3.7 
Node version: 0.10.29 
OS: Windows_NT 6.2.9200 x64 

Ho provato a installare altri pacchetti e falliscono con lo stesso errore. Ho un bel setup di vaniglia per quanto ne so. Esecuzione di Windows 8.1 x64. Non riesco a trovare informazioni pertinenti sul motivo per cui sto ricevendo questo errore.

+1

Ho lo stesso problema. Ho provato il downgrade all'ultima versione di bower che funzionava prima (1.3.5) e svuotando la cache di npm senza alcun risultato. Inoltre ho rimosso il mio file bower.json, la cartella bower_components e ho ancora ricevuto l'errore per tutti i pacchetti (con o senza il flag -S) ... –

+0

Bummer. Beh, almeno non sono solo su questo. Non ho avuto fortuna quando ho cancellato la mia cartella cache npm. – Adam

+0

Anch'io. Mi chiedo se questo è un problema con Github (GitHubResolver)? Questo sembra diventare improvvisamente un problema nell'ultima ora. – CMikeB1

risposta

21

Correzione: Clear cache and update to Bower 1.3.8.

This è quello che sta succedendo:

The tmp package updated it's API to return a cleanup callback in addition to just the directory name. Q then squashes the two arguments to the callback into an array, while bower expected just a string for the directory name.

This causes "TypeError: Arguments to path.join must be strings" errors to appear, seemingly non-deterministic, because various spots attempt to use the _tempDir value (now an array) to join into a path.

semver ftw!

+0

Fantastico! Grazie, supporto e lavoro. Lascia fare a me per trovare questi bug 0day: D – Adam

+0

Sei il benvenuto, questo mi ha fatto tirare fuori anche i capelli. Fortunatamente mi sono imbattuto nel feed Twitter di Bower. Buono per i Bower per essere al top delle cose. – CMikeB1

1

Per le altre persone che sono ancora in esecuzione in questo, questo ha fatto il trucco per me:

bower cache clean 
1

Per me npm install -update bower non era sufficiente.

avevo bisogno di installare la versione da specificando che esplicito:

sudo npm install -q [email protected]

e sì, ho dovuto correre questo con sudo.

Problemi correlati