错误:命令失败:/ bin / sh -c cd mean&& npm安装

时间:2016-03-14 09:23:57

标签: javascript node.js mean-stack meanjs mean.io

所以我收到了这个错误:

bash-3.2$ yo meanjs
You're using the official MEAN.JS generator.
? What mean.js version would you like to generate? 0.4.0
0.4.0
? In which folder would you like the project to be generated? This can be changed later. mean
Cloning the MEAN repo.......
? What would you like to call your application? MEAN
? How would you describe your application? Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js
? How would you describe your application in comma seperated key words? MongoDB, Express, AngularJS, Node.js
? What is your company/author name? 
? Would you like to generate the article example CRUD module? Yes
? Would you like to generate the chat example module? Yes
Running npm install for you....
This may take a couple minutes.
Error: Command failed: /bin/sh -c cd mean && npm install
npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/mona/.nvm/versions/node/v4.0.0/bin/node" "/Users/mona/.nvm/versions/node/v4.0.0/bin/npm" "install"
npm ERR! node v4.0.0
npm ERR! npm  v2.14.2
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! syscall connect

npm ERR! network connect ETIMEDOUT 23.235.39.162:443
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/mona/interviews/mean/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)

请帮我解决。

我输入的命令的历史记录:

 567  git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`
  569  . ~/.nvm/nvm.sh
  570  vim ~/.bashrc
  571  source ~/.bashrc
  572  nvm install 4.0
  573  nvm use 4.0
  574  cd ..
  578  yo meanjs
  579  sudo rm -rf mean/
  580  yo meanjs

此外:

bash-3.2$ npm info generator-meanjs version
0.4.4

其他信息以防万一:

bash-3.2$ npm install -g generator-meanjs
npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm

> spawn-sync@1.0.15 postinstall /Users/mona/.nvm/versions/node/v4.0.0/lib/node_modules/generator-meanjs/node_modules/yeoman-generator/node_modules/cross-spawn/node_modules/spawn-sync
> node postinstall

/
> yo@1.5.1 postinstall /Users/mona/.nvm/versions/node/v4.0.0/lib/node_modules/generator-meanjs/node_modules/yo
> yodoctor


Yeoman Doctor
Running sanity checks on your system

✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✖ Node.js version

Your Node.js version is outdated.
Upgrade to the latest version: https://nodejs.org

✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✖ npm version

Your npm version is outdated.

Upgrade to the latest version by running:
npm install -g npm


Found potential issues on your machine :(
generator-meanjs@0.4.4 /Users/mona/.nvm/versions/node/v4.0.0/lib/node_modules/generator-meanjs
├── mkdirp@0.5.1 (minimist@0.0.8)
├── chalk@1.1.1 (escape-string-regexp@1.0.5, supports-color@2.0.0, strip-ansi@3.0.1, has-ansi@2.0.0, ansi-styles@2.2.0)
├── ejs@2.3.4
├── underscore.string@3.2.3
├── bluebird@3.0.6
├── underscore.inflections@0.2.1 (underscore@1.8.3)
├── rimraf@2.5.2 (glob@7.0.3)
├── lodash@4.0.1
├── html-wiring@1.2.0 (detect-newline@1.0.3, cheerio@0.19.0)
├── yeoman-generator@0.21.1 (read-chunk@1.0.1, detect-conflict@1.0.0, yeoman-welcome@1.0.1, path-is-absolute@1.0.0, text-table@0.2.0, user-home@2.0.0, xdg-basedir@2.0.0, dargs@4.1.0, class-extend@0.1.2, yeoman-assert@2.1.1, debug@2.2.0, istextorbinary@1.0.2, find-up@1.1.2, path-exists@2.1.0, async@1.5.2, nopt@3.0.6, shelljs@0.5.3, cli-table@0.3.1, glob@5.0.15, through2@2.0.1, mem-fs-editor@2.2.0, yeoman-environment@1.5.2, read-pkg-up@1.0.1, pretty-bytes@2.0.1, github-username@2.1.0, cross-spawn@2.1.5, inquirer@0.11.4, dateformat@1.0.12, download@4.4.3, gruntfile-editor@1.1.0, lodash@3.10.1, sinon@1.17.3)
└── yo@1.5.1 (titleize@1.0.0, figures@1.4.0, humanize-string@1.0.1, user-home@2.0.0, string-length@1.0.1, async@1.5.2, opn@3.0.3, repeating@2.0.0, sort-on@1.2.2, configstore@1.4.0, root-check@1.0.0, yeoman-character@1.1.0, yosay@1.1.0, npm-keyword@4.2.0, package-json@2.3.1, cross-spawn-async@2.1.9, got@5.5.0, yeoman-environment@1.5.2, fullname@2.1.0, inquirer@0.11.4, meow@3.7.0, read-pkg-up@1.0.1, update-notifier@0.5.0, insight@0.7.0, lodash@3.10.1, yeoman-doctor@2.1.0)
bash-3.2$ npm ls
@ /Users/mona/interviews/mean
└── (empty)

我很困惑我最终应该使用哪个版本的节点!!当我切换回节点4.0来解决问题但现在yo抱怨版本不是最新版本。

0 个答案:

没有答案