Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrat init 执行报错 #22

Open
xuhuan opened this issue Feb 9, 2015 · 23 comments
Open

scrat init 执行报错 #22

xuhuan opened this issue Feb 9, 2015 · 23 comments

Comments

@xuhuan
Copy link

xuhuan commented Feb 9, 2015

在空目录下执行scrat init 后报错
error You don't seem to have a generator with the name scrat installed.

全局安装了 generator-scrat 后依旧无效。
重装过 scrat 依旧无效,带上 -c 参数后依旧无效。

执行 yo 后有 scrat 选项,
image
但是选择后执行报错,提示fis不存在,
image

fis之前就安装过且是最新版本。
image

scrat 也是最新版。
image

node路径确定是配置过的,其他的都在跑,不至于说这一个没有配置。

scrat 和 generator-scrat 安装在同一个目录。

系统win2003。
image
node v0.12.0
npm v2.5.1

@fouber
Copy link
Member

fouber commented Feb 9, 2015

@xuhuan

不要独立安装 generator-scrat,删除掉之后,重新安装scrat,然后执行scrat init -c试试呢

@xuhuan
Copy link
Author

xuhuan commented Feb 10, 2015

@fouber 一开始没有独立安装 generator-scrat 的时候就重装过 scrat,结果也是不行。

image

image

刚才又执行了一边,结果依旧。

@fouber
Copy link
Member

fouber commented Feb 10, 2015

@xuhuan

scrat init -c,-c参数加了么?

如果加了还不行,你用的是什么操作系统?

@xuhuan
Copy link
Author

xuhuan commented Feb 10, 2015

image

@fouber 参数加了的,win2003 系统。

@fouber
Copy link
Member

fouber commented Feb 10, 2015

@xuhuan

你的npm包安装路径包含中文么?

@xuhuan
Copy link
Author

xuhuan commented Feb 10, 2015

@fouber 全英文路径,系统Application Data目录里面

@atian25
Copy link
Member

atian25 commented Jun 26, 2015

题主,现在如何了?

@candyHuang
Copy link

我安装了最新的v0.5.2版本,也遇到这个问题,window7 @atian25 @fouber 这个怎么破?

@atian25
Copy link
Member

atian25 commented Jun 27, 2015

发下报错截图?

@ql2005
Copy link

ql2005 commented Dec 24, 2015

=,= v0.5.12 这个问题还在...
OSX 10.10.3, scrat v0.5.12, fis v1.9.39 , node v4.2.3, npm 2.14.7
报错只有一句话 ~
error You don't seem to have a generator with the name scrat installed.

重新安装了一次居然可以了.....

@atian25
Copy link
Member

atian25 commented Feb 1, 2016

有可能是 scrat-command-init 的问题, 最近升级的 scrat 都没动这个模块.

@jiayisheji
Copy link

在空目录下执行scrat init 后报错
error You don't seem to have a generator with the name scrat installed.
v0.5.14
node 5.4.1
npm 3.3.13
win10

@fouber
Copy link
Member

fouber commented Feb 22, 2016

@jiayisheji

scrat 是npm -g 安装的么?

@atian25
Copy link
Member

atian25 commented Feb 22, 2016

云龙,我有点怀疑他们是node 5.x的npm3导致的,扁平化目录?

@atian25
Copy link
Member

atian25 commented Mar 4, 2016

@jiayisheji @ql2005 降级npm为2.x看看

@myseawp
Copy link

myseawp commented Jun 8, 2016

最近我们也遇到这个问题了
使用npm3+,在安装scrat-command-init组件的时候,依赖的generator-scrat没有自动安装上
导致上面的错误

回退到npm2.14.7,没问题了

@jiayisheji
Copy link

@myseawp 现在很多npm包都需要3+版本

@henryzp
Copy link

henryzp commented Sep 25, 2016

我报同样的错误。

error You don't seem to have a generator with the name scrat installed.

楼上有人解决了吗?

scrat版本:0.8.0

npm版本:3.10.6
node版本:6.2.2

系统是mac

@myseawp
Copy link

myseawp commented Dec 1, 2016

这个确实是npm3的扁平化目录问题
yeoman-generator只会找根目录到当前项目目录、npm全局目录,但npm3的依赖包是放在npm包/node_modules下,可以改下init组件代码:

process.env.NODE_PATH = fs.existsSync(localPath)?localPath:path.join(__dirname, '..')

通过判断localPath,扁平化目录结构,localPath肯定为空的;或者全局安装下generator组件,yeoman-generator也会查找全局目录

@woshi82
Copy link

woshi82 commented Dec 23, 2016

我的npm 3.10.7
process.env.NODE_PATH = fs.existsSync(path.join(localPath, 'generator-scrat'))?localPath:path.join(__dirname, '..');
这样设置有效。
全局安装generator-scrat无效。

@wanaright10
Copy link

wanaright10 commented Jan 10, 2017

看来都有这个问题啊, 一开始用这个框架就
error You don't seem to have a generator with the name scrat installed.
请问我还怎么继续? 重装几次都一样

@henryzp
Copy link

henryzp commented Jan 10, 2017

@wanaright10 ,我已经放弃了。。

据说现在FIS3都没人维护了

@gisonyeung
Copy link

在项目目录下本地安装一次scrat不就可以执行scrat init了吗,为什么没人说

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests