我在运行yo webapp时遇到一个错误:“使用sudo很简单。约曼是这里的主人。”
请帮帮我。我在yoeman.io网站上遵循了同样的说明。
如果不使用sudo,则在/usr/node/中运行并使用chmod将目录更改为777时,
错误: EACCES,在主目录(fs.js:427:18)的本地模块( Object.fs.writeFileSync )的本地模块(fs.js:966:15)的权限被拒绝位于本地的本地模块(/ Object.create.all.set /manish/ Object.Configstore /lib/Object.create.all.set_ (/home/manish/local/lib/node_modules/yo/node_modules/insight/node_modules/configstore/configstore.js:39:7) /yo对象的新洞察(/home/manish/local/lib/node_modules/yo/node_modules/insight/lib/insight.js:20:16)处的/node_modules/insight/node_modules/configstore/configstore.js:30:11)。(/home/manish/local/lib/node_modules/yo/bin/yo:26:15) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12)
发布于 2013-07-16 18:32:48
之所以会发生这种情况,是因为您必须尝试以root身份启动应用程序。
有关更多信息,请参阅:https://github.com/passy/yo/commit/d33e7a67d74343d836a14881b17b3072b92f2532
如果您通过运行以下命令来启动应用程序:
sudo node app.js试着这样做:
node app.js也就是说,这不会尝试以root用户身份启动应用程序。
如果您正在尝试创建应用程序,脚手架也是如此。如果您在主目录(~/)下执行该操作,则不需要使用sudo。
发布于 2013-10-16 19:42:55
这里有一个精选的shell脚本的要点,可以帮助您在不需要sudo权限的情况下安装Node和NPM:
发布于 2014-02-25 06:36:48
所以你在跑吗?给出了上面的错误-也许就像我一样,它使用根权限安装了~/Users/yourusername/.config/configstore/insight-yo.yml,这需要修改用户名。
chown yourusername ~/Users/yourusername/.config/configstore/insight-yo.yml
这是我的问题,可能是这里给出的完整解决方案的一部分https://gist.github.com/isaacs/579814
https://stackoverflow.com/questions/17673492
复制相似问题