npm - 强制grunt插件更新

标签 npm gruntjs

我正在将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中有一个 Unresolved 问题,它谈论的是同一件事。当npm install工作正常时,npm update不会更新devDependencies。

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

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

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

关于npm - 强制grunt插件更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15710883/

相关文章:

javascript - Express module.js :550 throw err; ^ Cannot find module

node.js - 如何在没有 sudo 的情况下运行 NPM?

node.js - 如何删除 node_modules - Windows 中的深层嵌套文件夹

javascript - grunt 复制将构建文件夹移动到项目之外

PHP内置服务器认为端口不可用,但netstat不同意

javascript - 在没有 grunt 和 gulp 等构建工具的情况下使用 Javascript 框架?

node.js - 如何禁用 `npm install --prefix` 的本地包依赖?

gruntjs - 从Grunt任务运行Mocha时,堆栈跟踪被隐藏

GIT:如何以高效的方式观察本地变化?

reactjs - 从私有(private) gitlab 存储库中使用 npm 安装依赖项