【问题标题】:Forcing grunt plugin update强制 grunt 插件更新
【发布时间】:2014-04-10 20:45:36
【问题描述】:

我将Gruntgrunt-contrib-copy 插件一起使用。最近提交了一个新版本(0.4.1),它有一个不错的新功能,我想利用它。但是,当我尝试使用 npm update grunt-contrib-copy 进行更新时,没有任何反应。

这是我当前的版本:

$ sudo npm list grunt-contrib-copy
UI@2.0.89 /Users/username/src/project/UI
└── grunt-contrib-copy@0.4.0 

这是我的更新尝试:

$ sudo npm update grunt-contrib-copy

没有输出——npm list 仍然显示 0.4.0。

验证可用的最新版本:

$ sudo npm info grunt-contrib-copy
npm http GET https://registry.npmjs.org/grunt-contrib-copy
npm http 200 https://registry.npmjs.org/grunt-contrib-copy

{ name: 'grunt-contrib-copy',
  description: 'Copy files and folders.',
  'dist-tags': { latest: '0.4.1' },
  versions: 
   [ '0.2.0',
    ... other versions snipped ...
     '0.4.0',
     '0.4.1' ],
  maintainers: 
   [ 'tkellen <tyler@sleekcode.net>',
     'cowboy <cowboy@rj3.net>',
     'shama <kyle@dontkry.com>' ],
  time: 
   { '0.2.0': '2012-09-10T22:26:15.048Z',
    ... other versions snipped ...
     '0.4.0': '2013-02-18T17:24:36.757Z',
     '0.4.1': '2013-03-26T20:08:14.079Z' },
  author: 'Grunt Team (http://gruntjs.com/)',
  repository: 
   { type: 'git',
     url: 'git://github.com/gruntjs/grunt-contrib-copy.git' },
  version: '0.4.1',

  ... other config info snipped ...

  dist: 
   { shasum: 'f0753b40ae21bb706daefb0b299e03cdf5fa9d6e',
     tarball: 'http://registry.npmjs.org/grunt-contrib-copy/-/grunt-contrib-copy-0.4.1.tgz' },
  directories: {} }

我在这里缺少什么?为什么 npm 不将此插件更新到当前可用的版本?

【问题讨论】:

    标签: npm gruntjs


    【解决方案1】:

    目前在 NPM 中有一个未解决的问题,它谈到了同样的事情。 npm update 不会更新 devDependencies 而 npm install 工作正常。

    https://github.com/isaacs/npm/issues/2369

    所以我可以推荐的是尝试使用 npm install 代替:

    $ sudo npm install grunt-contrib-copy --save-dev
    

    【讨论】:

    • 使用 install 就可以了。感谢您提供指向打开的错误的指针。
    【解决方案2】:

    你可以看看……

    npm install grunt-dev-update --save-dev
    

    来自https://npmjs.org/package/grunt-dev-update

    【讨论】:

      【解决方案3】:

      sudo npm update grunt-* 现在似乎可以正常工作了。

      问题https://github.com/isaacs/npm/issues/2369 现已关闭。

      【讨论】:

      • 欢迎来到 SO。请考虑使用代码标签编辑您的帖子,它看起来会更好;)
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-02-14
      • 1970-01-01
      • 2014-01-09
      • 2017-09-06
      • 1970-01-01
      • 2019-10-26
      相关资源
      最近更新 更多