windows上的mean.io安装

时间:2015-04-01 10:56:20

标签: node.js mean.io

我按照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

1 个答案:

答案 0 :(得分: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();
};

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

希望很快就会解决这个问题。