0

次の内容の package.json があります。

{
  "name": "useless-app",
  "version": "1.0.0",
  "dependencies": {},
  "devDependencies": {
    "grunt": "~0.4.1",
    "grunt-contrib-copy": "~0.4.0",
    "grunt-contrib-concat": "~0.2.0",
    "grunt-contrib-coffee": "~0.6.6",
    "grunt-contrib-jst": "~0.5.0",
    "grunt-contrib-uglify": "~0.2.0",
    "grunt-contrib-compass": "~0.2.0",
    "grunt-contrib-jshint": "~0.4.3",
    "grunt-contrib-cssmin": "~0.6.0",
    "grunt-contrib-connect": "0.3.0",
    "grunt-contrib-clean": "0.4.0",
    "grunt-contrib-htmlmin": "0.1.3",
    "grunt-contrib-imagemin": "0.1.4",
    "grunt-contrib-livereload": "0.1.2",
    "grunt-mocha": "~0.3.1",
    "grunt-bower-requirejs": "~0.4.1",
    "grunt-usemin": "~0.1.10",
    "grunt-requirejs": "~0.3.5",
    "grunt-regarde": "~0.1.1",
    "grunt-open": "~0.2.0",
    "matchdep": "~0.1.2"
  },
  "engines": {
    "node": ">=0.8.0"
  }
}

これは、Yeoman が標準として私のために構築したものです。私が電話したときnpm install、またはnpm install -g何のアクションも得られなかったときは、これだけです:

Alex@iMac-2 ~/Sites/Backbone/Yeoman$ sudo npm install -g
useless-app@1.0.0 /usr/local/lib/node_modules/useless-app

この時点で、ダウンロードおよびインストールされるアプリケーションのリストを期待していました。いずれにせよ、grunt (リストの項目の 1 つ) を実行してこれをテストすると、次の結果が得られます。

Alex@iMac-2 ~/Sites/Backbone/Yeoman$ grunt
-bash: grunt: command not found

これらのものがインストールされない理由はありますか?

これらのコマンドを使用sudoしてみましたが、結果は常に同じです。

4

2 に答える 2

0

このような問題が発生した場合はrm -rf node_modules、端末で実行してからもう一度実行してくださいnpm install

于 2020-04-18T20:23:01.620 に答える