Arnaud Carrere
Arnaud Carrere

Reputation: 35

Hyperledger composer-cli error EACCESS

I'm starting to build an app on Hyperledger Composer following these instructions.

When I run :

$ npm install -g composer-cli

the package is correctly installed here : /home/arnaud/.nvm/versions/node/v8.11.1/bin/composer

However when I try to run composer --version I have the following error EACCESS :

$ composer --version /home/arnaud/.nvm/versions/node/v8.11.1/lib/node_modules/composer-cli/node_modules/mkdirp/index.js:90 throw err0; ^ Error: EACCES: permission denied, mkdir '/home/arnaud/.composer/logs' at Object.fs.mkdirSync (fs.js:885:18) at Function.sync (/home/arnaud/.nvm/versions/node/v8.11.1/lib/node_modules/composer-cli/node_modules/mkdirp/index.js:71:13) at Object.exports.getLogger (/home/arnaud/.nvm/versions/node/v8.11.1/lib/node_modules/composer-cli/node_modules/composer-common/lib/log/winstonInjector.js:76:20) at Function._loadLogger (/home/arnaud/.nvm/versions/node/v8.11.1/lib/node_modules/composer-cli/node_modules/composer-common/lib/log/logger.js:633:25) at Function._setupLog (/home/arnaud/.nvm/versions/node/v8.11.1/lib/node_modules/composer-cli/node_modules/composer-common/lib/log/logger.js:531:30) at Function.getLog (/home/arnaud/.nvm/versions/node/v8.11.1/lib/node_modules/composer-cli/node_modules/composer-common/lib/log/logger.js:508:20) at Object.<anonymous> (/home/arnaud/.nvm/versions/node/v8.11.1/lib/node_modules/composer-cli/node_modules/composer-common/lib/businessnetworkmetadata.js:18:20) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32)

How could I solve this problem ? Many thanks

Upvotes: 0

Views: 461

Answers (3)

user2385937
user2385937

Reputation: 11

The above issue purely a permission issue, while installing composer-cli basically the folder v8.11.1 is own by different users, i.e. other than your user id. Hence we are facing this issue. We need to change the owner and group of the v8.11.1 folder as follows. Navigat to the folder v8.11.1 (/home/arnaud/.nvm/versions/node/v8.11.1) and then verify whether the folder is user and group are your user id (arnaud). Surely the folder was not own by arnaud user and group. Change the folder user and group by using chown.

Upvotes: 1

Paul O&#39;Mahony
Paul O&#39;Mahony

Reputation: 6740

the logging error as RThatcher describes below - its trying to write to a logfile and part of that is to create the logs directory, but it doesn't have permissions. Did you previously do an install of Composer with 'sudo' ? what does ls -al /home/arnaud/.composer/* show (who owns the directories). I ask, because its strange that you can write everywhere else under your home directory (as you'd expect to, as arnaud) . Assuming of course, that you are running the composer --version command above, while logged in as 'arnaud' and not as another user?

Upvotes: 0

R Thatcher
R Thatcher

Reputation: 5570

Error: EACCES: permission denied, mkdir '/home/arnaud/.composer/logs'

This is the core error suggesting that you don't have permissions to create the logs folder on the /home/arnaud/.composer folder or that you do not have the rights to create the .composer folder in the /home/arnaud/ folder.

You should use a combination of ls -al , chmod and possibly chown Linux commands to investigate and resolve the permissions problem.

Upvotes: 0

Related Questions