grunt服务器错误 - 无法创建目录

时间:2015-01-20 11:36:19

标签: gruntjs yeoman

我和自耕农一起使用grunt,我收到了这个错误。现在 我可以用--force忽略此警告,但感觉不舒服。

kim@ubuntu:~/testApp$ grunt serve
Running "serve" task

Running "clean:server" (clean) task

Running "concurrent:server" (concurrent) task
    Warning: Running "copy:styles" (copy) task
    Warning: Unable to create directory "/home/kim/testApp/.tmp" (Error code: EACCES). Use --force to continue.

    Aborted due to warnings.


    Execution Time (2015-01-20 11:25:22 UTC)
    loading tasks  3ms  ▇▇▇▇▇▇▇▇▇▇▇▇ 25%
    copy:styles    9ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 75%
    Total 12ms Use --force to continue.

        Aborted due to warnings.


Execution Time (2015-01-20 11:25:20 UTC)
concurrent:server  1.9s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 100%
Total 1.9s

kim@ubuntu:~/testApp$

1 个答案:

答案 0 :(得分:0)

" /home/kim/testApp/.tmp"路径是相对的,所以它可能试图在您的计算机根目录上创建此路径,如果您在Mac中,那么Macintosh HD和grunt对root没有写入权限。

除非您使用来自终端的sudo运行grunt命令,否则它将在root中创建路径,而不是您要查找的内容。

--force命令不应该在这里做任何事情,它只是跳过警告并继续执行剩余的任务,但它不会创建目录。

尝试将您的相对路径更改为绝对路径,例如: " / Users / YourUserFolderName / ..这里文件夹的完整路径../ home / kim / testApp / .tmp"

我注意到你在ubuntu上,但可能是同样的问题。

相关问题