简体   繁体   中英

lb (loopback cli) command not found - MacOS

I'm trying to install loopback globally using:

npm i -g loopback-cli

then when I run the command lb I get :

bash: lb: command not found

when I do nano ~/.bashrc or nano ~/.bash_profile I see an empty file.

Then I entered in those files

export PATH=/usr/local/lib/node_modules/node/bin/lb

lb still not working , But then my other commands stopped working (node, ng, etc etc) too. Then I went back and erased those 2 files that I created, and my old commands went back to work, but the lb didn't work.

尝试使用 lb4 获取最新版本的环回。

In my case, installed using the command:

$ sudo npm install -g @loopback/cli

It not worked:

$ lb4
-bash: lb4: command not found

But it worked by path:

$ /usr/local/opt/node/bin/lb4 app
? Project name: (projects)

I created an alias in .bash_profile:

alias lb4="/usr/local/opt/node/bin/lb4"

And now working fine:

$ lb4 app
? Project name: (bayma) 

nvm: No
node version: v12.14.1
macOS: 10.14.6
error -bash: lb4: command not found

我在版本 3 上取得了成功。

sudo -i yarn global add loopback-cli

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM