我想在xUbuntu上安装Ionic。
当我执行sudo npm install -g ionic
,我得到以下输出,但不知道问题是什么。
npm WARN package.json eyes@0.1.8 No repository field. npm WARN package.json faye-websocket@0.4.4 'repositories' (plural) Not supported. npm WARN package.json Please pick one as the 'repository' field npm WARN package.json indexof@0.0.1 No repository field. /usr/local/bin/ionic -> /usr/local/lib/node_modules/ionic/bin/ionic > node-sass@3.4.2 install /usr/local/lib/node_modules/ionic/node_modules/node-sass > node scripts/install.js sh: 1: node: not found npm WARN This failure might be due to the use of legacy binary "node" npm WARN For further explanations, please read /usr/share/doc/nodejs/README.Debian npm ERR! node-sass@3.4.2 install: `node scripts/install.js` npm ERR! Exit status 127 npm ERR! npm ERR! Failed at the node-sass@3.4.2 install script. npm ERR! This is most likely a problem with the node-sass package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node scripts/install.js npm ERR! You can get their info via: npm ERR! npm owner ls node-sass npm ERR! There is likely additional logging output above. npm ERR! System Linux 4.2.0-27-generic npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "ionic" npm ERR! cwd /home/sisko npm ERR! node -v v0.10.25 npm ERR! npm -v 1.4.21 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/sisko/npm-debug.log npm ERR! not ok code 0
sh:1:节点:找不到
这似乎是错误的原因。
您可能只需要安装传统的nodejs包:
sudo apt-get install nodejs-legacy
有关更多信息,请参阅在Ubuntu中无法使用节点包管理器安装软件包
另一种方法是使用nvm
https://github.com/creationix/nvm#installation ,它可以让你在不同版本的节点之间切换
nvm install node --reinstall-packages-from=node nvm alias default node