Closed ian4hu closed 6 years ago
node 的版本是?
[ian@ian-mbp /tmp/git/front]$ node -v
v5.10.1
换回 LTS 4.x 版本吧, init 用的 yeoman , 对 npm3 的扁平化判断哪里有问题
@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
跟了下, 好像是 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 这个库
尝试过其他几个选项seo和olpm都是这样的错误