Unable to create yeoman webapp

こ雲淡風輕ζ 提交于 2019-12-05 14:15:34
Mohammad Amir

I was facing the same issue. I ran the command below, It fixed my problem:

mkdir -p /root/.config/configstore

chmod g+rwx /root /root/.config /root/.config/configstore

The same issue happened to me, i was in root mode user#. I just get back to normal user$ and it worked. i am using Zorin OS

Animesh

I was able to fix this by running:

echo prefix = ~/.node >> ~/.npmrc

and

export PATH=$HOME/.node/bin:$PATH

Explanation here:

Error installing yeoman
What does `echo prefix = ~/.node >> ~/.npmrc` mean?
npm / yeoman install generator-angular without sudo

Deepak Kaithwas

I just fixed it in Windows. I have done three things, which one have fixed it I am not sure.

Run cmd prompt as administrator.

takeown /? this command is equivalent to chown (linux) but for windows.

cacls -cacls /E /T /G :F

simply go in $USER /Users/calvin/.config/configstore/ and make files unhidden.

it worked for me like charm. I have been trying to fix this since many days.

I had the same issue building a meanjs app on Ubuntu and I've fixed this issue using sudo instead of root:

sudo npm install -g yo generator-meanjs bower grunt

Then i could build the app without being asked for password again:

yo meanjs

sudo allows user to act as root without root login, it is more secure to use sudo instead of logging in as root. sudo vs root - askubuntu

wimh supports Monica

Although the chmod command seemed to work at first, I got a similar error later, for a different folder. But here I found this workaround which fixed that too:

sed -i -e '/rootCheck/d' "${NPM_CONFIG_PREFIX}/lib/node_modules/yo/lib/cli.js"

If yo is run as root, rootCheck will downgrade to UID 1000 (on Linux) or 501 (on OS X). This causes the permission error. But in a docker container, you might want to run as root, so you have no other option.

You need to rerun this command after upgrading yeoman. In case NPM_CONFIG_PREFIX is not defined, you can use:

export NPM_CONFIG_PREFIX=$(npm config get prefix)
Adam Fuzum

the issue is that yo is not granted to use some of the nodejs modules. basically, y the problem is related to authorization of yo by node package manager "npm", to fix this run this command first

sudo npm install --global yo --allow-root
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!