折腾:
期间,zsh中找不到命令bower:
➜ JiandaoWorkbench bower install framework7 zsh: command not found: bower |
所以需要先去安装bower
mac zsh: command not found: bower
twitter – Bower, Grunt & zsh: command not found: – Stack Overflow
osx yosemite – Bower not installing on zsh – Super User
[已解决]mac中zsh command not found npm
然后继续去安装bower:
➜ JiandaoWorkbench npm install bower [email protected] node_modules/bower ➜ JiandaoWorkbench npm install -g bower npm ERR! tar.unpack untar error /Users/crifan/.npm/bower/1.7.9/package.tgz npm ERR! Darwin 15.6.0 npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “install” “-g” “bower” npm ERR! node v4.4.7 npm ERR! npm v2.15.8 npm ERR! path /usr/local/lib/node_modules/bower npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall mkdir npm ERR! Error: EACCES: permission denied, mkdir ‘/usr/local/lib/node_modules/bower’ npm ERR! at Error (native) npm ERR! { [Error: EACCES: permission denied, mkdir ‘/usr/local/lib/node_modules/bower’] npm ERR! errno: -13, npm ERR! code: ‘EACCES’, npm ERR! syscall: ‘mkdir’, npm ERR! path: ‘/usr/local/lib/node_modules/bower’, npm ERR! fstream_type: ‘Directory’, npm ERR! fstream_path: ‘/usr/local/lib/node_modules/bower’, npm ERR! fstream_class: ‘DirWriter’, npm ERR! fstream_stack: npm ERR! [ ‘/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25’, npm ERR! ‘/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53’, npm ERR! ‘FSReqWrap.oncomplete (fs.js:82:15)’ ] } 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/crifan/dev/dev_root/daryun/JianDaoWeixin/sourcecode/UIDemo/JiandaoWorkbench/npm-debug.log ➜ JiandaoWorkbench sudo npm install -g bower Password: /usr/local/bin/bower -> /usr/local/lib/node_modules/bower/bin/bower [email protected] /usr/local/lib/node_modules/bower |
->
最终用:
sudo npm install -g bower
去全局安装了bower
➜ ~ bower -v 1.7.9 |
再去把刚才不小心用:
npm install bower |
安装到本地的bower删除掉:
➜ JiandaoWorkbench ll total 0 drwxr-xr-x 4 crifan staff 136B 8 4 11:41 node_modules ➜ JiandaoWorkbench rm node_modules rm: node_modules: is a directory ➜ JiandaoWorkbench rm node_modules -rf rm: node_modules: is a directory rm: -rf: No such file or directory ➜ JiandaoWorkbench rm -rf node_modules ➜ JiandaoWorkbench ll ➜ JiandaoWorkbench |
然后重新打开终端,确保是可以找到用:
sudo npm install -g bower |
安装的全局的bower:
➜ JiandaoWorkbench which bower /usr/local/bin/bower ➜ JiandaoWorkbench ll |