2

私は gruntjs を初めて使用し、grunt-init テンプレートを起動して実行しようとしていますが、常に次のエラーが発生します。zsh: command not found: grunt-init

インストールを実行すると、これらすべてが表示されるので、正常にインストールされているようです

→ npm install -g grunt-init
/Users/jsturgess/npm-global/bin/grunt-init -> /Users/jsturgess/npm-global/lib/node_modules/grunt-init/bin/grunt-init
grunt-init@0.3.2 /Users/jsturgess/npm-global/lib/node_modules/grunt-init
├── semver@1.0.14
├── colors@0.6.2
├── async@0.2.10
├── hooker@0.2.3
├── lodash@2.4.1
├── prompt@0.1.12 (async@0.1.22, pkginfo@0.3.0, winston@0.5.11)
└── grunt@0.4.5 (which@1.0.9, dateformat@1.0.2-1.2.3, eventemitter2@0.4.14, getobject@0.1.0, rimraf@2.2.8, async@0.1.22, grunt-legacy-util@0.2.0, exit@0.1.2, nopt@1.0.10, lodash@0.9.2, coffee-script@1.3.3, underscore.string@2.2.1, glob@3.1.21, iconv-lite@0.2.11, grunt-legacy-log@0.1.1, js-yaml@2.0.5, minimatch@0.2.14, findup-sync@0.1.3)

私は grunt-init のインストール指示に従い、~/.grunt-init/ディレクトリを作成し、与えられたコマンドを介してjqueryテンプレートを複製しました

git clone https://github.com/gruntjs/grunt-init-jquery.git ~/.grunt-init/jquery

grunt-init コマンドを使用できるようにするには、何をする必要がありますか?

4

2 に答える 2

1

この記事から行った npm アクセス許可の変更を元に戻すことで、この問題を修正しました: https://docs.npmjs.com/getting-started/fixing-npm-permissions

于 2015-05-14T15:13:19.383 に答える