Ritesh Arora
Ritesh Arora

Reputation: 33

mean.io installation on windows

I followed the steps as specified at http://learn.mean.io/. I ran cmd as an adiminstrator. But i'm getting below error on running but getting below error:

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

Upvotes: 3

Views: 3856

Answers (1)

Nikola
Nikola

Reputation: 320

If you open %APPDATA%\npm\node_modules\mean-cli\lib\ you will see at the line 59 something like this:

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();
};

The command: var findCmd = 'find ' + homeDir +'/.npm ' + '-user root'; will not work on windows. Try to remove whole shell.exec(...) segment for workaround on your windows machine and then try to init your mean app again.

Hope this will be fixed soon.

Upvotes: 7

Related Questions