gpt4 book ai didi

angularjs - 在 grunt 调试后保存代码时出现 .Fatal 错误 : grunt. util._.contains 不是函数

转载 作者:太空宇宙 更新时间:2023-11-03 23:29:43 24 4
gpt4 key购买 nike

我有两个版本的 grunt,一个是全局的,一个是本地的。grunt-cli v1.2.0咕噜声 v1.0.1我想卸载 v1.0.1。运行 grunt debug 命令时,它运行成功,但在保存代码时收到此 fatal error :grunt.util._.contains 不是函数。

bower.json

{
"name": "__",
"version": "__",
"devDependencies": {
"angular": "^1.5.5",
"angular-ui-router": "^0.2.18",
"angular-mocks": "^1.5.5",
"angular-bootstrap": "^1.3.2",
"ngstorage": "^0.3.10",
"bootstrap": "^3.3.6",
"angular-resource": "^1.2.28",
"ng-file-upload-shim": "^12.0.4",
"ng-file-upload": "^12.0.4"
},
"dependencies": {
"angularjs-slider": "^5.4.1"
}
}

package.json

    {
"author": "....",
"name": "....",
"version": "1.0.0",
"homepage": ".....",
"licenses": {
"type": "MIT",
"url": "...."
},
"bugs": "....",
"repository": {
"type": "git",
"url": "..."
},
"dependencies": {},
"devDependencies": {
"grunt": "^1.0.1",
"grunt-bump": "0.0.6",
"grunt-coffeelint": "~0.0.10",
"grunt-contrib-clean": "^0.4.1",
"grunt-contrib-coffee": "^0.7.0",
"grunt-contrib-concat": "^0.3.0",
"grunt-contrib-copy": "^0.4.1",
"grunt-contrib-jshint": "^0.4.3",
"grunt-contrib-less": "~0.11.0",
"grunt-contrib-uglify": "^0.2.7",
"grunt-contrib-watch": "^0.4.4",
"grunt-conventional-changelog": "^0.1.2",
"grunt-html2js": "^0.1.9",
"grunt-karma": "^0.8.2",
"grunt-ng-annotate": "^0.8.0",
"karma": "^0.12.9",
"karma-coffee-preprocessor": "^0.2.1",
"karma-firefox-launcher": "^0.1.3",
"karma-jasmine": "^0.1.5"
}
}

最佳答案

这是由于 grunt 版本不兼容,所以我按照以下命令操作:我卸载了 Grunt:

>npm uninstall -g grunt

我安装了 Grunt-cli:

>npm install -g grunt-cli

然后我检查了版本:

>grunt --version

grunt-cli v1.2.0
grunt v1.0.1

我得到了上述回复,但我需要 grunt v0.4.5

然后我安装了所需的 grunt 版本:

npm install grunt@0.4.5 --save-dev

现在我没有收到上述指定的错误。

关于angularjs - 在 grunt 调试后保存代码时出现 .Fatal 错误 : grunt. util._.contains 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39699956/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com