【问题标题】:npm install command doing nothingnpm install 命令什么都不做
【发布时间】:2013-05-01 21:31:58
【问题描述】:

我有一个包含以下内容的 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 installnpm 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(列表中的一项)对此进行测试,结果如下:

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

任何想法为什么这些东西没有安装?

我已尝试对这些命令使用sudo,结果始终相同。

【问题讨论】:

    标签: git npm yeoman gruntjs


    【解决方案1】:

    你安装了 grunt-cli 吗?请记住,在最新版本的 Grunt 中,您需要使用 grunt-cli 才能执行 grunt 命令。

    试试sudo npm install -g grunt-cli

    最好的问候, 凯文。

    【讨论】:

      【解决方案2】:

      对于遇到此类问题的任何人,请尝试在您的终端上运行 rm -rf node_modules 并再次运行 npm install

      【讨论】:

        猜你喜欢
        • 2014-11-17
        • 2018-05-04
        • 1970-01-01
        • 2016-02-28
        • 2017-03-22
        • 1970-01-01
        • 2019-01-25
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多