使用npminstall函数自定义yeoman生成器问题

时间:2014-09-22 16:39:05

标签: json npm yeoman-generator

我一直在检查一些关于创建自定义yeoman发生器的指南。

最后,我有这个:

runNpm: function(){
var done = this.async();
this.npmInstall("", function(){
    console.log("\nEverything Setup !!!\n");
    done();
});

我假设我的工作就好像为package.json依赖项输入npm install。 问题是我收到了这个错误:

5 error install Couldn't read dependencies
6 error package.json ENOENT, open 'C:\Users\Fabritzio\Desktop\donald\package.json'
6 error package.json This is most likely not a problem with npm itself.
6 error package.json npm can't find a package.json file in your current directory.
7 error System Windows_NT 6.2.9200
8 error command "C:\\Program Files\\nodejs\\\\node.exe""C:\\ProgramFiles\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
9 error cwd C:\Users\Fabritzio\Desktop\donald
10 error node -v v0.10.30
11 error npm -v 1.4.21
12 error path C:\Users\Fabritzio\Desktop\donald\package.json
13 error code ENOPACKAGEJSON
14 error errno 34
15 verbose exit [ 34, true ]

这是package.json

{
"name": "usaria",
"description": "Small scope system using firebase and angularjs.",
"author": "Donald Villegas",
"contributors": [],
"dependencies": [],
"version": "0.1.0",
"devDependencies": {
    "grunt": "~0.4.5",
    "grunt-contrib-uglify": "~0.5.0"
},
"repository": {
  "type": "git",
  "url": "git://github.com/FabVillegas/usaria"
}}

1 个答案:

答案 0 :(得分:0)

修正了它,它创建了没有ERROR标记的所有内容:

更改了此

runNpm: function(){
    var done = this.async();
    this.npmInstall("", function(){
    console.log("\nEverything Setup !!!\n");
    done();
});

到此

runNpm: function(){
    this.npmInstall();
    this.bowerInstall("angularfire");
    console.log("\nEverything Setup !!!\n");
});