windows上的mean.io安装

Rit*_*ora 3 node.js mean.io

我按照http://learn.mean.io/中指定的步骤进行操作.我作为一个adiminstrator运行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
Run Code Online (Sandbox Code Playgroud)

小智 7

如果你打开,%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();
};
Run Code Online (Sandbox Code Playgroud)

命令:var findCmd = 'find ' + homeDir +'/.npm ' + '-user root';不适用于Windows.尝试shell.exec(...)在Windows计算机上删除整个段以获得解决方法,然后再次尝试使用init您的平均应用程序.

希望这很快就能解决.