无法使用yeoman生成器生成meanjs

时间:2015-09-25 09:57:09

标签: node.js msbuild

我试图用yo meanjs命令生成Meanjs, 。安装了发电机发电机 - meanjs。 但是当我尝试安装meanjs时,我遇到了错误。请建议做什么。

    Unhandled rejection Error: Command failed: C:\Windows\system32\cmd.exe /s /c "cd mean && npm install"

    npm WARN engine karma@0.12.37: wanted: {"node":">=0.8 <=0.12 || >=1 <=2"} (current: {"node":"4.1.1","npm":"3.3.3"})

    npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"4.1.1","npm":"3.3.3"})

    npm WARN install Couldn't install optional dependency: Unsupported

    npm WARN install Couldn't install optional dependency: Unsupported

    npm WARN prefer global jshint@2.8.0 should be installed with -g

    npm WARN prefer global node-gyp@3.0.3 should be installed with -g

    npm WARN prefer global nodemon@1.3.8 should be installed with -g
    gyp ERR! build error

    gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1

            gyp ERR! stack     at ChildProcess.onExit (C:\Users\LENOVO\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:270:23)





            gyp ERR! stack     at emitTwo (events.js:87:13)
    gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
    gyp ERR! System Windows_NT 6.1.7601

             gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\LENOVO\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"


            gyp ERR! cwd C:\MEANProject\mean\node_modules\selenium-webdriver\node_modules\bu fferutil
    gyp ERR! node -v v4.1.1
    gyp ERR! node-gyp -v v3.0.1
    gyp ERR! not ok
    npm WARN EPACKAGEJSON mean@0.0.0 No repository field.
    npm ERR! Windows_NT 6.1.7601
    npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\LENOVO\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
    npm ERR! node v4.1.1
    npm ERR! npm  v3.3.3
    npm ERR! code ELIFECYCLE

    npm ERR! bufferutil@1.1.0 install: `node-gyp rebuild`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the bufferutil@1.1.0 install script 'node-gyp rebuild'.
    npm ERR! This is most likely a problem with the bufferutil package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR!     node-gyp rebuild
    npm ERR! You can get their info via:
    npm ERR!     npm owner ls bufferutil
    npm ERR! There is likely additional logging output above.

    npm ERR! Please include the following file with any support request:
    npm ERR!     C:\MEANProject\mean\npm-debug.log

at ChildProcess.exithandler (child_process.js:203:12)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:817:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:469:12)

以下是设置:

$ node -v
 v4.1.1
$ npm --v
2.14.3
$ yo --version
1.4.8

请建议..

2 个答案:

答案 0 :(得分:1)

检查出来 https://github.com/meanjs/generator-meanjs/issues/117

希望它会有所帮助!

尝试使用较低版本的Node(0.12.7)

答案 1 :(得分:0)

看起来你安装了节点4.1.1。 Yeoman生成器尚不支持该版本的Node,因为它不支持io.js。

如果您仍想使用meanjs,则必须将节点版本降级为0.12.x