【问题标题】:How can I install grunt.js in node.js manually?如何在 node.js 中手动安装 grunt.js?
【发布时间】:2016-06-05 06:37:13
【问题描述】:

是否可以在node.js中手动安装grunt.js

实际上我的支持团队下载了 grunt.js 用于 windows 机器并放置在我的机器中。

由于我的公司代理无法通过节点npm install -g grunt-cli 安装。

所以想安装和下载包一样的形式。

或者我们可以在没有 node.js 的情况下安装 grunt.js?

【问题讨论】:

标签: node.js windows gruntjs npm npm-install


【解决方案1】:

尽管手动安装模块很容易,只需将其放入node_modules/grunt 或直接引用它require('./path/to/grunt/directory'),真正的问题是您还需要递归下载grunt's dependencies 及其依赖项。

└─┬ grunt@0.4.5
  ├── async@0.1.22
  ├── coffee-script@1.3.3
  ├── colors@0.6.2
  ├── dateformat@1.0.2-1.2.3
  ├── eventemitter2@0.4.14
  ├── exit@0.1.2
  ├─┬ findup-sync@0.1.3
  │ ├─┬ glob@3.2.11
  │ │ ├── inherits@2.0.1
  │ │ └── minimatch@0.3.0
  │ └── lodash@2.4.2
  ├── getobject@0.1.0
  ├─┬ glob@3.1.21
  │ ├── graceful-fs@1.2.3
  │ └── inherits@1.0.2
  ├─┬ grunt-legacy-log@0.1.3
  │ ├─┬ grunt-legacy-log-utils@0.1.1
  │ │ ├── lodash@2.4.2
  │ │ └── underscore.string@2.3.3
  │ ├── lodash@2.4.2
  │ └── underscore.string@2.3.3
  ├── grunt-legacy-util@0.2.0
  ├── hooker@0.2.3
  ├── iconv-lite@0.2.11
  ├─┬ js-yaml@2.0.5
  │ ├─┬ argparse@0.1.16
  │ │ ├── underscore@1.7.0
  │ │ └── underscore.string@2.4.0
  │ └── esprima@1.0.4
  ├── lodash@0.9.2
  ├─┬ minimatch@0.2.14
  │ ├── lru-cache@2.7.3
  │ └── sigmund@1.0.1
  ├─┬ nopt@1.0.10
  │ └── abbrev@1.0.7
  ├── rimraf@2.2.8
  ├── underscore.string@2.2.1
  └── which@1.0.9

所以要么你必须安装所有这些包,要么将它们安装在另一台机器上并复制它们,要么尝试使用像 browserify、webpack 或其他东西的打包器。

【讨论】:

    猜你喜欢
    • 2011-08-12
    • 1970-01-01
    • 2021-07-25
    • 2018-01-11
    • 2017-03-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多