2015-08-10 15 views
5

Quando si esegue npm install sui nostri server di costruire di Windows, il comando non riesce a intermittenza confallisce npm installare in modo casuale su Windows

error errno: -4048, 
error code: 'EPERM', 
error path: 'C:\\Users\\bamboo\\AppData\\Roaming\\npm-cache\\readable-stream\\1.0.33\\package\\package.json', 
error parent: 'through2' } 
error Please try running this command again as root/Administrator. 

anche se il comando viene eseguito come amministratore in un prompt dei comandi in esecuzione come amministratore. Il pacchetto che il comando ha esito negativo varia di volta in volta e altri computer Windows non presentano questo problema quando si esegue npm install con la stessa origine.

Ho provato npm cache clean e manualmente cancellando il contenuto della directory C: \ Users \% username% \ AppData \ npm-cache senza fortuna. Ho anche esaminato le autorizzazioni sulla directory npm-cache, la directory di installazione di NodeJS e la directory contenente il checkout del codice sorgente e tutte mostrano che il gruppo di amministratori ha le autorizzazioni complete e che l'utente amministratore (che sta eseguendo il comando npm install) possiede la directory. Ho anche provato l'ultima versione di npm (2.13.4), oltre a una versione precedente (2.11.3).

Che cosa sta causando questo errore di autorizzazioni?

Di seguito si riporta il contenuto del file NPM-debug.log:

236980 info install [email protected] 
236981 info postinstall [email protected] 
236982 info install [email protected] 
236983 info postinstall [email protected] 
236984 verbose unlock done using C:\Users\bamboo\AppData\Roaming\npm-cache\_locks\npm-723363012edbbbaa.lock for c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules\npm 
236985 verbose stack Error: EPERM, rename 'C:\Users\bamboo\AppData\Roaming\npm-cache\readable-stream\1.0.33\package\package.json' 
236985 verbose stack  at Error (native) 
236986 verbose cwd c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web 
236987 error Windows_NT 6.3.9600 
236988 error argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--msvs_version=2013" 
236989 error node v0.12.7 
236990 error npm v2.11.3 
236991 error path C:\Users\bamboo\AppData\Roaming\npm-cache\readable-stream\1.0.33\package\package.json 
236992 error code EPERM 
236993 error errno -4048 
236994 error Error: EPERM, rename 'C:\Users\bamboo\AppData\Roaming\npm-cache\readable-stream\1.0.33\package\package.json' 
236994 error  at Error (native) 
236994 error { [Error: EPERM, rename 'C:\Users\bamboo\AppData\Roaming\npm-cache\readable-stream\1.0.33\package\package.json'] 
236994 error errno: -4048, 
236994 error code: 'EPERM', 
236994 error path: 'C:\\Users\\bamboo\\AppData\\Roaming\\npm-cache\\readable-stream\\1.0.33\\package\\package.json', 
236994 error parent: 'through2' } 
236995 error Please try running this command again as root/Administrator. 
236996 verbose exit [ -4048, true ] 
236997 verbose unbuild node_modules\gulp-replace-task\node_modules\through2 
236998 info preuninstall [email protected] 
236999 info uninstall [email protected] 
237000 verbose unbuild rmStuff [email protected] from c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules 
237001 verbose unbuild rmStuff in c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules\gulp-replace-task\node_modules 
237002 info postuninstall [email protected] 
237003 silly gentlyRm c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules\gulp-replace-task\node_modules\through2 is being purged from base c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web 
237004 verbose gentlyRm don't care about contents; nuking c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules\gulp-replace-task\node_modules\through2 
237005 silly vacuum-fs purging c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules\gulp-replace-task\node_modules\through2 
237006 silly vacuum-fs quitting because other entries in c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules\gulp-replace-task\node_modules 
237007 verbose unbuild node_modules\browser-sync\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\utf-8-validate 
237008 info preuninstall [email protected] 
237009 info uninstall [email protected] 
237010 verbose unbuild rmStuff [email protected] from c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules 
237011 verbose unbuild rmStuff in c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules\browser-sync\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules 
237012 info postuninstall [email protected] 
237013 silly gentlyRm c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules\browser-sync\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\utf-8-validate is being purged from base c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web 
237014 verbose gentlyRm don't care about contents; nuking c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules\browser-sync\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\utf-8-validate 
237015 silly vacuum-fs purging c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules\browser-sync\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\utf-8-validate 
237016 silly vacuum-fs quitting because other entries in c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules\browser-sync\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules 
237017 verbose unbuild node_modules\browser-sync\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\bufferutil 
237018 info preuninstall [email protected] 
237019 info uninstall [email protected] 
237020 verbose unbuild rmStuff [email protected] from c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules 
237021 verbose unbuild rmStuff in c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules\browser-sync\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules 
237022 info postuninstall [email protected] 
237023 silly gentlyRm c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules\browser-sync\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\bufferutil is being purged from base c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web 
237024 verbose gentlyRm don't care about contents; nuking c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules\browser-sync\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\bufferutil 
237025 silly vacuum-fs purging c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules\browser-sync\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\bufferutil 
237026 silly vacuum-fs quitting because other entries in c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules\browser-sync\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules 
237027 verbose unbuild node_modules\gulp-replace-task 
237028 info preuninstall [email protected] 
237029 info uninstall [email protected] 
237030 verbose unbuild rmStuff [email protected] from c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules 
237031 info postuninstall [email protected] 
237032 silly gentlyRm c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules\gulp-replace-task is being purged from base c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web 
237033 verbose gentlyRm don't care about contents; nuking c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules\gulp-replace-task 
237034 silly vacuum-fs purging c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules\gulp-replace-task 
237035 silly vacuum-fs quitting because other entries in c:\bamboo-home\xml-data\build-dir\SB-MB-JOB1\Web\node_modules 
+0

Qual è la tua versione di npm? – Eric

+0

Ho provato con 2.11.3 e 2.13.4. – Brantino

+0

Sto incontrando lo stesso problema. Abbiamo provato diverse versioni di node e npm tramite npm 2.14.4 e node 4.1.2. Abbiamo anche provato a creare una cache npm separata per ogni build agent. Senza fortuna. –

risposta

0

ho gestito nello stesso errore ... Vedo state usando bambù anche. Così. Stai usando l'addon Node.js per Bamboo? Controlla Impostazioni -> Componenti aggiuntivi -> Trova nuovi componenti aggiuntivi.

Nell'impostazione dell'attività selezionare Tipo "NPM" e ingrandire la scheda "Impostazioni avanzate". Scegli "Usa cache isolata". Può essere che sia un po 'più lento, perché deve copiare tutto nella cache, ma Bamboo sta creando quella directory nella directory di casa di bambù.

Non ho ricevuto questo errore da allora. Funziona per me