简体   繁体   English

Grunt没有看到我的devDependency模块

[英]Grunt doesn't see my devDependency module

I installed this: 我安装了这个:

https://www.npmjs.com/package/derequire https://www.npmjs.com/package/derequire

with

npm install derequire --save-dev

It appeared in the package.json file 它出现在package.json文件中

"devDependencies": {
    "derequire": "^2.0.3",

but when in Gruntfile.js I do: 但是当在Gruntfile.js中执行时:

grunt.loadNpmTasks('derequire');

I get the following error: Local Npm module "derequire" not found. 我收到以下错误:找不到本地Npm模块“ derequire”。 Is it installed? 安装好了吗?

Other dependencies work fine. 其他依赖项工作正常。

I noticed that other dependencies are prefixed with 'grunt-' (eg: 'grunt-contrib-concat'). 我注意到其他依赖项以'grunt-'开头(例如:'grunt-contrib-concat')。 Does it mean that I can't use this NPM derequire in grunt? 这是否意味着我不能在咕unt声中使用此NPM取消要求? How can I enable it? 如何启用它?

grunt.loadNpmTasks('derequire'); doesn't work because it's supposed to be used with Grunt plugins. 不起作用,因为它应该与Grunt插件一起使用。 See the reference . 请参阅参考资料 You can't just use it with regular NPM packages. 您不能仅将其与常规NPM软件包一起使用。

For a list of Grunt plugins, take a look here . 有关Grunt插件的列表, 请在此处查看

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM