gpt4 book ai didi

build - Sublime Text 2 使用 Grunt v0.4.0 构建

转载 作者:行者123 更新时间:2023-12-01 01:11:15 25 4
gpt4 key购买 nike

我正在尝试设置 Sublime 构建过程来运行 Grunt (v0.4)
这是我的构建片段:

{
"cmd": ["grunt", "--no-color"],
"selector": ["Gruntfile.js"],
"path": "/usr/local/bin",
"working_dir": "${project_path}",
"osx": {
"cmd": ["grunt", "--no-color"]
}
}

当我点击 Command-B 时,出现以下错误:

grunt-cli: The grunt command line interface. (v0.1.6) Fatal error: Unable to find local grunt.

If you're seeing this message, either a Gruntfile wasn't found or grunt hasn't been installed locally to your project. For more information about installing and configuring grunt, please see the Getting Started guide:

http://gruntjs.com/getting-started [Finished in 0.2s with exit code 99]



当我跑 grunt从终端一切正常。

有任何想法吗?

最佳答案

这是 Sublime Text 的一个“错误”。当您点击 Ctrl+B ,它将以第一个打开的文件夹作为工作目录调用构建命令。因此,如果您尚未打开该文件夹,则它无法找到构建文件(Makefile,或在您的情况下为 Gruntfile)。

所以为了构建成功,你需要把你的 Gruntfile 作为工作目录放在文件夹中,然后在 Sublime Text 中打开文件夹并点击 Ctrl+B .

关于build - Sublime Text 2 使用 Grunt v0.4.0 构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15385424/

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