无法让“sails-generate-new-with-mast"发电机在sails 0.10中工作 [英] Can't get the 'sails-generate-new-with-mast' generator to work in sails 0.10

查看:31
本文介绍了无法让“sails-generate-new-with-mast"发电机在sails 0.10中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用全球安装的sails beta v0.10-rc8.我使用的是 mac osx 10.9.

working with sails beta v0.10-rc8 installed globally. i'm using mac osx 10.9.

sudo npm install sails@beta -g

然后我在全局(只是为了试一试)和本地安装了生成器 npm 包,该文件夹将包含要生成的项目,如下所示:

Then I installed the generator npm package both globally (just to give it a shot) and locally in the folder that will contain the project to be generated like:

~/projects& npm install sails-generate-new-with-mast

在包含项目的文件夹中创建了 .sailsrc 文件

created the .sailsrc file in the folder containing the project

~/projects/.sailsrc

并在

~/.sailsrc

文件内容为:

{
    generators: {
        modules: {
            new: 'sails-generate-new-with-mast'
        }
    }
}

尝试使用时

~/projects$ sails generate new MyApp

使用默认生成器.

我做错了什么?尝试了一段时间,但无法做到.

What am I doing wrong? tried for a while but couldn't do it.

提前致谢!

TR

推荐答案

生成器是 Sails v0.10 的一个非常强大的新功能,但是使用自定义生成器的系统仍然有点笨拙.你在正确的轨道上,但你需要在你的主目录 (~/node_modules/sails-generate-new-with-mast) 中安装生成器并添加一个 .sailsrcstrong> 主目录中的文件,其中包含生成器的绝对路径:

Generators are a really powerful new feature of Sails v0.10, but the system for utilizing custom ones is still a bit clunky. You were on the right track, but you need to install the generator in your home directory (~/node_modules/sails-generate-new-with-mast) and add a .sailsrc file in your home directory with an absolute path to the generator:

{
    generators: {
        modules: {
            new: '/Users/myusername/node_modules/sails-generate-new-with-mast'
        }
    }
}

然后 sails new 将使用该生成器.

Then sails new will use that generator.

我必须警告您,Mast 完全不受支持,遗憾的是,它几乎被废弃了.

I must warn you that Mast is completely unsupported and, sadly, pretty much abandoned.

这篇关于无法让“sails-generate-new-with-mast"发电机在sails 0.10中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆