2017-01-19 4 views
0

ich habe probleme bei der installation von babel auf mac os für transpiling es6 code für meine eigenen persönlichen projekte. Ich habe npm install -g babel eingegeben und diese Antworten zurückgegeben. Ich bin mir nicht sicher, ob das relevant ist, aber ich betreibe node.js v6.9.2.installation babel zum transpieren es6 code fehler

npm WARN deprecated [email protected]: Babel's CLI commands have been moved from the babel package to the babel-cli package 
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules 
/usr/local/lib 
└── [email protected] 

npm ERR! Darwin 16.3.0 
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "babel" 
npm ERR! node v6.9.2 
npm ERR! npm v3.10.9 
npm ERR! path /usr/local/lib/node_modules 
npm ERR! code EACCES 
npm ERR! errno -13 
npm ERR! syscall access 

npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules' 
npm ERR!  at Error (native) 
npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules' 
npm ERR!  at Error (native) 
npm ERR! errno: -13, 
npm ERR! code: 'EACCES', 
npm ERR! syscall: 'access', 
npm ERR! path: '/usr/local/lib/node_modules' } 
npm ERR! 
npm ERR! Please try running this command again as root/Administrator. 

npm ERR! Please include the following file with any support request: 
npm ERR!  /Users/Colin/npm-debug.log 
+0

die Fehlermeldungen sind ziemlich selbsterklärend ... Sie brauchen babel-cli, wenn Sie CLI-Befehle wollen, und Sie haben keinen Schreibzugriff auf einige Ordner –

+0

Ich weiß nicht, wie Sie es auf einem tun McComputer –

+0

Sie müssten 'npm babel zuerst deinstallieren und dann' npm babel-cli installieren. – loganfsmyth

Antwort

0

Es ist kein babel Problem. Sie haben ein Berechtigungsproblem mit npm bei der globalen Installation.

Die Schritte, um dies zu beheben, ist in the official docs.

Sie können dies entweder beheben, indem Sie Ihr globales Verzeichnis node_modules in Ihr Benutzerverzeichnis verschieben oder Homebrew zum Einrichten des Knotens verwenden.

+0

Ich habe es gerade herausgefunden, ich brauchte nur sudo npm -g install babel. Ich hatte einfach nicht die richtige Erlaubnis –

Verwandte Themen