没有找到指令

时间:2016-07-03 05:11:10

标签: vagrant yeoman homestead yo

在新的Homestead安装上安装后,我遇到了访问Yeoman的问题。在npm install -g yoyo doctor运行之后安装期间一切似乎都很好,并且在安装过程中没有发现任何问题。但是,在我安装了yeoman之后,yo: command not found是我在我的VM上收到的错误消息。

vagrant@homestead:~$ npm install -g yo
npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
/home/vagrant/.node/bin/yo -> /home/vagrant/.node/lib/node_modules/yo/lib/cli.js
/home/vagrant/.node/bin/yo-complete -> /home/vagrant/.node/lib/node_modules/yo/lib/completion/index.js

> spawn-sync@1.0.15 postinstall /home/vagrant/.node/lib/node_modules/yo/node_modules/spawn-sync
> node postinstall


> yo@1.8.4 postinstall /home/vagrant/.node/lib/node_modules/yo
> yodoctor


Yeoman Doctor
Running sanity checks on your system

✔ Global configuration file is valid
✔ Node.js version
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✔ npm version
✔ NODE_PATH matches the npm root

Everything looks all right!
/home/vagrant/.node/lib
└─┬ yo@1.8.4
  ├── async@1.5.2
  ├─┬ chalk@1.1.3
  │ ├── ansi-styles@2.2.1
  │ ├── escape-string-regexp@1.0.5
  │ ├── has-ansi@2.0.0
  │ ├── strip-ansi@3.0.1
  │ └── supports-color@2.0.0
  ├── cli-list@0.1.8
[[REMOVED FOR READABILITY]]
  └─┬ yosay@1.2.0
    ├── cli-boxes@1.0.0
    ├── pad-component@0.0.1
    ├─┬ taketalk@1.0.0
    │ ├── get-stdin@4.0.1
    │ └── minimist@1.2.0
    └── wrap-ansi@2.0.0

vagrant@homestead:~$ yo
yo: command not found

我在~/.bashrc中的路径说明了以下内容:PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/home/vagrant/.node/lib

我在这里还有什么可能导致这种情况的原因吗?

1 个答案:

答案 0 :(得分:1)

/home/vagrant/.node/bin添加到您的路径中。 :)