2014-09-08 26 views
6
npm install -g ember-cli 


npm ERR! Error: Attempt to unlock ember-cli, which hasn't been locked 
npm ERR!  at unlock (/usr/local/lib/node_modules/npm/lib/utils/locker.js:44:11) 
npm ERR!  at cb (/usr/local/lib/node_modules/npm/lib/cache/add-local.js:30:5) 
npm ERR!  at /usr/local/lib/node_modules/npm/lib/cache/add-local.js:47:20 
npm ERR!  at /usr/local/lib/node_modules/npm/lib/utils/locker.js:30:7 
npm ERR!  at /usr/local/lib/node_modules/npm/node_modules/lockfile/lockfile.js:167:38 
npm ERR!  at Object.oncomplete (fs.js:107:15) 
npm ERR! If you need help, you may report this *entire* log, 
npm ERR! including the npm and node versions, at: 
npm ERR!  <http://github.com/npm/npm/issues> 

npm ERR! System Linux 3.2.0-61-generic 
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "ember-cli" 
npm ERR! cwd /home/ahmed 
npm ERR! node -v v0.10.31 
npm ERR! npm -v 1.4.23 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  /home/ahmed/npm-debug.log 
npm ERR! not ok code 0 

bei der Installation mit sudo, dann beim Erstellen der neuen App ein Problem bekommen.Kann Ember-CLI nicht ohne Sudo installieren

sudo npm install -g ember-cli 
/usr/local/bin/ember -> /usr/local/lib/node_modules/ember-cli/bin/ember 
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/npm-registry-client/node_modules/couch-login requires [email protected]'~2.9.202' but will load 
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/request, 
npm WARN unmet dependency which is version 2.30.0 
[email protected] /usr/local/lib/node_modules/ember-cli 
├── [email protected] 
├── [email protected] 
├── [email protected] ([email protected], [email protected]) 
└── [email protected] ([email protected], [email protected], [email protected]) 
[email protected]:~$ ember -v 
version: 0.0.44 
node: 0.10.31 
npm: 1.4.26 

Antwort

12

Zunächst einmal entfernen Knoten vollständig

$ rm -rf ~/.npm ~/.nvm 

Verwenden NVM Knoten Version zu verwalten ...

$ curl https://raw.githubusercontent.com/creationix/nvm/v0.17.1/install.sh | bash 
$ source ~/.nvm/nvm.sh 
//add this line to my ~/.bashrc, ~/.profile, or ~/.zshrc 

im Profil Hinzufügen Quelle nano mit:

$ nano ~/.profile

bis Ende der Datei gehen und diese Zeile hinzu:

source ~/.nvm/nvm.sh

Then hit CTR+X and press Y to save für andere gleiche ...

Verwenden stabile Version des Knotens

$ nvm install 0.10.32 
$ nvm use 0.10.32 
$ nvm alias default 0.10.32 

Einmal Wenn Sie Node installiert haben, müssen Sie die Ember-CLI global mit folgendem Code installieren:

$ npm install -g ember-cli 

Dadurch erhalten Sie Zugriff auf den Ember-Befehlszeilen-Runner.

Sie müssen Bower installieren, einen Paketmanager, der Ihre Front-End-Abhängigkeiten (einschließlich JQuery, Ember und QUnit) auf dem neuesten Stand hält. Dies ist so einfach wie das Ausführen:

$ npm install -g bower 

Dadurch erhalten Sie Zugriff auf die Boomer-Befehlszeile runner.

Jetzt können Sie enberCLI-Befehle ausführen.

Prost.

+0

Funktioniert das auf Ubuntu? Was ist mit all dem Nodejs-Legacy-Drama? – iwayneo

+0

Ja, das wird auf Ubuntu funktionieren. –

+0

Ich arbeite auf Ubuntu, aber jedes Mal, wenn ich neu starte, ist der Terminal-Knoten nicht mehr vorhanden. Ich muss es installieren. Ist es das erwartete Verhalten? – user3568719

Verwandte Themen