V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
opengta
V2EX  ›  Node.js

osx 10.8.4 使用 node -g 全局安装以后,直接输入命令无法使用.

  •  
  •   opengta · 2013-06-19 16:50:05 +08:00 · 3152 次点击
    这是一个创建于 3964 天前的主题,其中的信息可能已经有所发展或是发生改变。
    首次使用 node.js ,问题不一定表述清楚.详细描述一下:

    1.使用 npm install -g yo grunt-cli bower 安装 yeoman

    2.然后 输入命令 :

    yo webapp
    -bash: yo: command not found

    根据网上的文档,使用 -g 安装成功以后,应该 yo 是个可以执行的命令.

    3.我是用的系统是 osx 10.8.4, 请问我这样是什么原因呢?
    2 条回复    1970-01-01 08:00:00 +08:00
    honk
        1
    honk  
       2013-06-19 16:58:01 +08:00   ❤️ 1
    /usr/local/share/npm/bin 應該加這個到 PATH 吧
    opengta
        2
    opengta  
    OP
       2013-06-19 17:15:38 +08:00
    谢谢你.根据你的提示,终于找到原因了.

    原来是 /usr/local/share/npm/bin 末尾多了一个空格.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1182 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 23:38 · PVG 07:38 · LAX 16:38 · JFK 19:38
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.