rossxu
rossxu

Reputation: 11

Error:Unable to install composer-cli

When I run npm install -g composer-cli I get this error:

"Need to have composer-cli installed at v0.15 or greater".

How can I resolve that?

Upvotes: 1

Views: 3411

Answers (5)

You need to use a 8.* node version, My solution was:

nvm install 8.9.0
nvm use 8.9.0
npm install -g composer-cli

Upvotes: 0

Kartikeya Sharma
Kartikeya Sharma

Reputation: 553

I changed my node version from

11

to

8.8.15

and did npm install -g composer-cli.It worked for me .

Upvotes: 0

Krishna Kankipati
Krishna Kankipati

Reputation: 93

Try this....this is the command to install 0.20 version.

npm install -g [email protected]

Upvotes: 0

R Thatcher
R Thatcher

Reputation: 5570

On Ubuntu (the supported Linux development environment) we do not recommend using sudo to install Composer.

The usual reason people would resort to sudo is a permission problem, but it is better to resolve the permission problem rather than use sudo. Often the problem is the npm prefix which can get set to /usr/local to which the user doesn't have write access. Issuing an npm config set prefix /home/<myuser>/ will solve the problem.

You may have an old version of Composer or one of the components installed. Try using npm ls -g --depth=0 to see if you have some composer code already installed, and if so remove it with npm uninstall -g composer-<component> where might be cli, or playground etc. The retry the install-g command.

Upvotes: 1

Suren Konathala
Suren Konathala

Reputation: 3597

Try running the command with --unsafe-perms , like this:

sudo npm install --unsafe-perm -g composer-cli

Reference: https://github.com/nodejs/node-gyp/issues/454

Upvotes: 5

Related Questions