scrat-team / scrat

Webapp Modular Framework
http://scrat-team.github.io/
773 stars 147 forks source link

scrat init 找不到 /Users/me/.scrat-tmp/init/webapp/_gitignore #62

Closed ian4hu closed 6 years ago

ian4hu commented 8 years ago
[ian@ian-mbp /tmp/git/front]$ scrat -v

         `-:////:-`                        
      ./ossssssssss+-                      
    -+sssssssssssssss+`                    
   .-...-+ssssssssssss/        .`          
          :ssssssssssso`      -o+`         
          .ossssssssss/       +ss+-.       
         `+ssssssssss+`     ./osssss+:`    
        -ossssssssso:` `.-/ossssssssss+`   
      .+sssssssss+:`  `.--:/+osssssssss/   
    `:osssssso+:``.-::/+++/-.`.:+ossssso`  
   `+sssssso:``-:/+//:-`.:+sso/-``.-::-.   
   :ssssss/`.//:---:/oso+-`.+sssoo+//:-`   
  `osssss/ `.``-:::-``.+ss+. :osssso//::`  
  `osssso.  `/osoooso/` /sso. `...`        
   /sssso. `+ss:```/ss/ `oss/              
   `+ssss: `oso.   -ss+ `oss/              
    `/ssso. -oso+/+oso. -sss:              
      ./oso/``-/+o+/-``:osss+/:-`          
        `.-//:.`   `.:++++++++//:`         

              v0.6.0

[ian@ian-mbp /tmp/git/front]$ scrat init
[?] Your project name: toolkit
[?] Your project version: 1.0.0
[?] What type of scrat project to init? webapp

     info ... Fetching https://codeload.github.com/scrat-team/scrat-template-webapp/tar.gz/master ...
     info This might take a few moments
..
✔ Done in /Users/ian/.scrat-tmp/init/webapp

/usr/local/lib/node_modules/.scrat_npminstall/yeoman-generator/0.17.7/yeoman-generator/lib/actions/actions.js:191
    throw new Error('Unable to read "' + filepath + '" file (Error code: ' + e.code + ').');
    ^

Error: Unable to read "/Users/ian/.scrat-tmp/init/webapp/_gitignore" file (Error code: ENOENT).
    at Generator.read (/usr/local/lib/node_modules/.scrat_npminstall/yeoman-generator/0.17.7/yeoman-generator/lib/actions/actions.js:191:11)
    at Generator.template (/usr/local/lib/node_modules/.scrat_npminstall/yeoman-generator/0.17.7/yeoman-generator/lib/actions/actions.js:286:19)
    at Generator.proto.dotFiles (/usr/local/lib/node_modules/.scrat_npminstall/generator-scrat/0.2.2-1/generator-scrat/app/index.js:123:10)
    at /usr/local/lib/node_modules/.scrat_npminstall/yeoman-generator/0.17.7/yeoman-generator/lib/base.js:395:14
    at tryOnImmediate (timers.js:534:15)
    at processImmediate [as _immediateCallback] (timers.js:514:5)
[ian@ian-mbp /tmp/git/front]$ls -al /Users/ian/.scrat-tmp/init/webapp/
total 0
drwxr-xr-x  3 ian staff 102  4 19 13:50 ./
drwxr-xr-x  4 ian staff 136  4 19 13:50 ../
drwxr-xr-x 14 ian staff 476  4 19 13:50 scrat-template-webapp-master/
[ian@ian-mbp /tmp/git/front]$ 

尝试过其他几个选项seo和olpm都是这样的错误

atian25 commented 8 years ago

node 的版本是?

ian4hu commented 8 years ago
[ian@ian-mbp /tmp/git/front]$ node -v
v5.10.1
atian25 commented 8 years ago

换回 LTS 4.x 版本吧, init 用的 yeoman , 对 npm3 的扁平化判断哪里有问题

ian4hu commented 8 years ago

@atian25 卸载了node 安装了node4-lts还是出错呢

[ian@ian-mbp /tmp/git/front]$ scrat init
[?] Your project name: toolkit
[?] Your project version: 1.0.0
[?] What type of scrat project to init? webapp

     info ... Fetching https://codeload.github.com/scrat-team/scrat-template-webapp/tar.gz/master ...
     info This might take a few moments
...
✔ Done in /Users/ian/.scrat-tmp/init/webapp

/usr/local/lib/node_modules/.scrat_npminstall/yeoman-generator/0.17.7/yeoman-generator/lib/actions/actions.js:191
    throw new Error('Unable to read "' + filepath + '" file (Error code: ' + e.code + ').');
    ^

Error: Unable to read "/Users/ian/.scrat-tmp/init/webapp/_gitignore" file (Error code: ENOENT).
    at Generator.read (/usr/local/lib/node_modules/.scrat_npminstall/yeoman-generator/0.17.7/yeoman-generator/lib/actions/actions.js:191:11)
    at Generator.template (/usr/local/lib/node_modules/.scrat_npminstall/yeoman-generator/0.17.7/yeoman-generator/lib/actions/actions.js:286:19)
    at Generator.proto.dotFiles (/usr/local/lib/node_modules/.scrat_npminstall/generator-scrat/0.2.2-1/generator-scrat/app/index.js:123:10)
    at /usr/local/lib/node_modules/.scrat_npminstall/yeoman-generator/0.17.7/yeoman-generator/lib/base.js:395:14
    at processImmediate [as _immediateCallback] (timers.js:383:17)
[ian@ian-mbp /tmp/git/front]$ node -v
v4.4.3
atian25 commented 8 years ago

跟了下, 好像是 yeoman-generator 的内部依赖升级导致的

https://github.com/scrat-team/generator-scrat/blob/master/app/index.js#L69

.scrat-tmp/init/webapp/scrat-template-webapp-master 后面那段改变了.

晚点再找时间修复吧, 你可以先自行下载 scrat-template-webapp 这个库