【发布时间】:2015-04-13 08:00:25
【问题描述】:
npm 知道 grunt 是全局安装的,为什么找不到呢?
$ npm install -g grunt
... installs ...
$ npm list -g | grep grunt
│ ├─┬ gruntfile-editor@0.2.0
│ ├─┬ gruntfile-editor@0.2.0
├─┬ grunt@0.4.5
│ ├─┬ grunt-legacy-log@0.1.1
│ ├── grunt-legacy-util@0.2.0
$ grunt
-bash: grunt: command not found
我假设是因为它把它放在了不在我的 PATH 上的地方。
为什么 npm 不把它放在我的默认路径上的某个地方,比如/usr/local/bin?
更新:奇怪的是,即使我在本地运行 npm install grunt 后,我也会收到相同的 grunt: command not found 错误。我究竟做错了什么?我的仓库中有一个Gruntfile.js。
【问题讨论】:
-
哦 ffs,那是因为我还没有完成
npm install -g grunt-cli。