gpt4 book ai didi

node.js - mean.io 在 Windows 上的安装

转载 作者:搜寻专家 更新时间:2023-10-31 23:32:57 24 4
gpt4 key购买 nike

我按照 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 您的平均应用程序。

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

关于node.js - mean.io 在 Windows 上的安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29388995/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com