failed to install composer-cli but I see errors

好久不见. 提交于 2019-12-02 08:20:06

This error occurs due to incompatibility of node version. You have to downgrade your node version to 8.x.x.

Just follow the steps written below:

First search for your desired package:

brew search node

This will give you the follow results:

leafnode            node                node@6              nodebrew
libbitcoin-node     node-build          node@8              nodeenv
llnode              node@10 ✔           node_exporter       nodenv
....

And then install the desired version:

brew install node@8

Also remember that you can install more than 1 node package at the same time, but you cannot have them available at the same time. So if you have the latest/generic node package already installed you need to unlink it first:

brew unlink node

And then you can link a different version:

brew link node@8

Now you can install composer-cli.

Note: Run the composer-tools installation commands without sudo or root.

This is because node has just released node 10 as lts and the prereqs-ubuntu.sh script installs the lts version of node so you are now getting node 10.

It's easy to fix, just before installing composer just run the following commands

nvm install 8
nvm use 8

this will install node 8 and then you are ready to install composer.

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