mean.io 安装于 windows

mean.io installation on windows

我按照 http://learn.mean.io/ 中指定的步骤进行操作。 我 运行 cmd 作为管理员。 但是我在 运行 上遇到错误,但在错误以下:

On windows platform - Please check permissions independently
All permissions should be run with the local users permissions
Cloning branch: master into destination folder: myApp2
git clone  --depth 1  -bmaster https://github.com/linnovate/mean.git "myApp2"
FIND: Parameter format not correct
There are 2 files in your ~/.npm owned by root
Please change the permissions by running - chown -R `whoami` ~/.npm
C:\Users\CE\AppData\Roaming\npm\node_modules\mean-cli\lib\utils.js:67
      throw('ROOT PERMISSIONS IN NPM');
      ^
ROOT PERMISSIONS IN NPM

如果您打开 %APPDATA%\npm\node_modules\mean-cli\lib\,您将在 59 行看到如下内容:

exports.checkNpmPermission = function (callback){
  var homeDir = process.env[isWin ? 'USERPROFILE' : 'HOME'];
  var findCmd = 'find ' + homeDir +'/.npm ' + '-user root';
  shell.exec(findCmd, function( status, output){
    var hasRootFiles = output.split(/\r\n|\r|\n/).length;
    if (hasRootFiles > 1){
      console.log (chalk.red('There are ' + hasRootFiles + ' files in your ~/.npm owned by root'));
      console.log(chalk.green('Please change the permissions by running -'), 'chown -R `whoami` ~/.npm ');
      throw('ROOT PERMISSIONS IN NPM');
    }
  });
  callback();
};

命令:var findCmd = 'find ' + homeDir +'/.npm ' + '-user root'; 对 windows 无效。尝试在您的 windows 机器上删除整个 shell.exec(...) 段以解决问题,然后再次尝试 init 您的平均应用程序。

希望这个问题能尽快解决。