Gruntjs 起吊时发出咕噜声错误——无前端

Gruntjs 起吊时发出咕噜声错误——无前端,gruntjs,sails.js,Gruntjs,Sails.js,我有一个帆Api,第一次像一个魅力靴子。 按CTRL+C组合键停止,然后再次尝试启动。它起作用了,但是 error: ** Grunt :: An error occurred. ** error: ------------------------------------------------------------------------ Aborted due to warnings. Running "clean:dev" (clean) task Warning: Cannot de

我有一个帆Api,第一次像一个魅力靴子。 按CTRL+C组合键停止,然后再次尝试启动。它起作用了,但是

error: ** Grunt :: An error occurred. **
error: 
------------------------------------------------------------------------
Aborted due to warnings.
Running "clean:dev" (clean) task
Warning: Cannot delete files outside the current working directory. 
------------------------------------------------------------------------

error: Looks like a Grunt error occurred--
error: Please fix it, then **restart Sails** to continue running tasks (e.g. watching for changes in assets)
error: Or if you're stuck, check out the troubleshooting tips below.

error: Troubleshooting tips:
error: 
error:  *-> Are "grunt" and related grunt task modules installed locally?  Run `npm install` if you're not sure.
error: 
error:  *-> You might have a malformed LESS, SASS, CoffeeScript file, etc.
error: 
error:  *-> Or maybe you don't have permissions to access the `.tmp` directory?
error:      e.g., `folderthingy` ?
error: 
error:      If you think this might be the case, try running:
error:      sudo chown -R 501 folderthingy
好吧,我检查了所有这些,文件夹就是我自己的,有足够的权限。我还安装了一个777用于测试,但这并没有改变任何事情

然后,我决定清除.tmp文件夹的所有内容,并尝试再次启动。这就像一个魔咒,.tmp再次被填满,当我停止服务器,试图重新启动它时,我再次收到完全相同的错误消息

我启动时没有前端选项,所以事实上我不明白它为什么要加载grunt


为什么会这样?这里出了什么问题?

如果您使用的是Linux,请尝试执行
sudo sails lift
,您可能会遇到权限问题(发生在我身上)。如果是Windows-请检查是否没有文件管理器或其他程序阻止.tmp文件夹(在Total Commander中打开该文件夹时,我也会遇到这种情况)。
在任何情况下,由于您不使用前端,您只需删除一些grunt任务(在tasks文件夹中/you have
README.md
,其中解释了在何种情况下运行哪些任务)或全部任务(请参阅),您就不会遇到问题。

我在学习本教程时遇到了同样的问题:

我创建了一个“链接器”文件夹,因为那家伙就是这么做的,然后提示我错误。看起来他使用的是旧版本的SailsJS,因为他没有遇到任何错误


您是否在资产文件夹中创建了新文件夹?如果您这样做了,问题是grunt无法在特定文件夹上运行任务,因为它没有与其他
资产
文件夹和文件链接。请尝试将所有新创建的文件放置在现有文件夹中,然后重试。这对我很有效。

人类仍然不知道为什么会发生这种情况,但我通过删除Grunfile来修复它。

我也遇到了这个错误-

error: ** Grunt :: An error occurred. **
error: 
------------------------------------------------------------------------
Aborted due to warnings.
Running "sass:dev" (sass) task

    > error: Looks like a Grunt error occurred--
    > 
    > error: Please fix it, then **restart Sails** to continue running tasks
    > (e.g. watching for changes in assets)
    > 
    > error: Or if you're stuck, check out the troubleshooting tips below.

error: Troubleshooting tips:
error: 
error:  *-> Are "grunt" and related grunt task modules installed locally?  Run `npm install` if you're not sure.
error: 
error:  *-> You might have a malformed LESS, SASS, CoffeeScript file, etc.
error: 
error:  *-> Or maybe you don't have permissions to access the `.tmp` directory?
error:      e.g., `/Users/siyaram.malav/Desktop/repo/project1/.tmp` ?
出现此错误是因为找不到sass模块。并运行以下命令

sudo gem安装sass

这对我有用

在您的情况下,请尝试运行sudogem安装clean命令

它应该会起作用。
谢谢。

通过以下步骤修复此问题:

sails应用程序->tasks/config/sync.js中的文件路径

// 1. Install it as a local dependency of your Sails app:
//    ```
//    $ npm install grunt-sync --save-dev --save-exact
//    ```
//
//
// 2. Then uncomment the following code:
//
// ```
// // Load Grunt plugin from the node_modules/ folder.
// grunt.loadNpmTasks('grunt-sync');
// ```
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

注意:未找到用于警告“sync:dev”的工作

我使用MacOsx,我想知道为什么会出现错误:)选项:{force:true},可以在tasks/config/clean.js中设置。这解决了问题issue@cfl在我描述过的情况下,这不会有帮助的不,我没有。但已修复,删除了此处显示的GrunFileFix: