解决方案“未找到命令”:Node.js的错误:全局模块:
- 权限错误 - 固定与评论信心通过卡迪尔
- 斌鲍尔采购 - 固定与清晰度从约西亚评论
- 须藤乔敦 - R的$(WHOAMI):管理员在/ usr /本地
.bower瞩目
if [ -r ~/.profile ]; then . ~/.profile; fi
case "$-" in *i*) if [ -r ~/.bashrc ]; then . ~/.bashrc; fi;; esac
的.profile
PATH=~/npm-global/bin:$PATH
原来的错误开拓者
Mac OS X的船长巨岩|节点v5.0 | NPM 3.4.0
npm工作,像git工作的全局命令。
bower -g
项目不起作用。
Aarons-MacBook-Air:test2 Akorn$ ionic start todo blank
-bash: ionic: command not found
Aarons-MacBook-Air:test2 Akorn$ ionic --version
-bash: ionic: command not found
Aarons-MacBook-Air:test2 Akorn$ npm ionic -l -v
3.4.0
权限错误
Aarons-MacBook-Air:test2 Akorn$ brew update && brew upgrade node
Error: The /usr/local directory is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. Some versions of the
"InstantOn" component of Airfoil are known to do this.
You should probably change the ownership and permissions of /usr/local
back to your user account.
sudo chown -R $(whoami):admin /usr/local
Aarons-MacBook-Air:test2 Akorn$ brew --version
Homebrew 0.9.5 (git revision fb84; last commit 2015-12-22)
问题 我可以信任sudo的修正?
有没有更好的解决办法?
是否有进一步诊断的方法?
我是如何解决这个问题的?
更新不正确或NPM节点 - 然而这样调用NPM从错误的文件夹全局函数。
错误地使用brew。
难看的代码在
.profile
/.profile_bash
。~/.bash_profile
:source ~/.profile
~/.profile
:export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
您是否注意到“错误:/ usr/local目录不可写入”。在运行'brew'命令后行?这应该可能与权限错误有关。当你运行'ls -l/usr'时,你在** local **目录中看到了什么权限?你有没有试过这样的建议,你应该运行'sudo chown -R $(whoami):admin/usr/local' – Kadir
$ ls -l/usr> local读取'root wheel'然后我运行了sudo代码,现在>本地读取'Akorn Admin'**弓**弓我害怕sudo,但现在我明白这条线执行什么 – Akorn