Failed to create yoman webapp

I get this when I try to create a webapp with yeoman.

/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/configstore/configstore.js:66
                throw err;
                      ^
Error: EACCES, permission denied '/root/.config/configstore/insight-yo.yml'
You don't have access to this file.

    at Object.fs.openSync (fs.js:436:18)
    at Object.fs.writeFileSync (fs.js:975:15)
    at Object.create.all.set (/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/configstore/configstore.js:56:8)
    at Object.Configstore (/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/configstore/configstore.js:19:11)
    at new Insight (/usr/local/lib/node_modules/yo/node_modules/insight/lib/insight.js:23:34)
    at process.<anonymous> (/usr/local/lib/node_modules/yo/node_modules/insight/lib/push.js:11:16)
    at process.emit (events.js:98:17)
    at handleMessage (child_process.js:322:10)
    at Pipe.channel.onread (child_process.js:349:11)

I googled and I tried the following things, but this did not help:

chown root /root/.config/configstore/insight-yo.yml 

chown myusername /root/.config/configstore/insight-yo.yml 

Installed npm-sudo-fixand launched it, but so far failed.

I am on Debian Wheezy and have npm 1.4.4.

+4
source share
7 answers

I ran into the same problem. I ran the command below, it fixed my problem:

mkdir -p /root/.config/configstore

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

The same thing happened to me, I was in root mode user #. I will just go back to regular $ users, and it worked. I am using Zorin OS

+2
source

, :

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

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

:

youoman
` echo prefix = ~/.node → > ~/.npmrc` ?
npm/yoman angular sudo

+1

Windows. , , .

cmd, .

takeown /? chown (linux), .

cacls -cacls /E /T /G :F

$USER /Users/calvin/.config/configstore/ .

. .

+1

, meanjs Ubuntu, , sudo root:

sudo npm install -g yo generator-meanjs bower grunt

, :

yo meanjs

sudo root root, sudo root. sudo vs root - askubuntu

+1

, yo nodejs. , yo node "npm",

sudo npm install --global yo --allow-root
0

chmod , , . , :

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

If it yostarts as root, it rootCheckwill switch to UID 1000 (on Linux) or 501 (on OS X). This causes a permission error. But in the docker container, you can run it as root, so you have no other option.

You need to re-run this command after updating yoman. If NPM_CONFIG_PREFIXnot defined, you can use:

export NPM_CONFIG_PREFIX=$(npm config get prefix)
0
source

Source: https://habr.com/ru/post/1546394/


All Articles