loopback icon indicating copy to clipboard operation
loopback copied to clipboard

bash: slc: command not found

Open tianshuo opened this issue 12 years ago • 9 comments

After installing using sudo npm -g install strong-cli, slc cannot be found

tianshuo avatar May 26 '14 02:05 tianshuo

Hi @tianshuo, I need more information about your system setup to be able to help you. Please post the output of the following commands:

which node
which npm
npm config get globalconfig
echo $PATH

bajtos avatar May 26 '14 07:05 bajtos

Also the output when you run in sudo mode:

sudo which node
sudo which npm
sudo npm config get globalconfig
sudo sh -c 'echo $PATH'

bajtos avatar May 26 '14 07:05 bajtos

Do you have /usr/local/bin on your $PATH?

raymondfeng avatar May 26 '14 15:05 raymondfeng

which node = /usr/local/bin/node which npm = /usr/local/bin/npm npm config get globalconfig=/usr/local/etc/npmrc echo $PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/deployd/bin

sudo which node = /usr/local/bin/node sudo which npm = /usr/local/bin/npm sudo npm config get globalconfig=/usr/local/etc/npmrc sudo sh -c 'echo $PATH'= /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/deployd/bin

On Mon, May 26, 2014 at 3:30 PM, Miroslav Bajtoš [email protected]:

Hi @tianshuo https://github.com/tianshuo, I need more information about your system setup to be able to help you. Please post the output of the following commands:

which node which npm npm config get globalconfig echo $PATH

— Reply to this email directly or view it on GitHubhttps://github.com/strongloop/loopback/issues/281#issuecomment-44164013 .

胡天硕 TiansHUo Blog: http://tianshuohu.diandian.com

tianshuo avatar May 28 '14 06:05 tianshuo

Thanks. The environment is configured in the usual way, it should not be the source of the problem.

When you run npm -g install strong-cli, it should create these files for you:

# all sources of strong-cli
/usr/local/lib/node_modules/strong-cli/

# symlink to enable `slc` command
/usr/local/bin/slc -> ../lib/node_modules/strong-cli/bin/slc

Please check the files were created on your machine and that slc permissions have executable flag turned on of all users.

You can also try to re-install the package:

sudo npm uninstall -g strong-cli
sudo npm install -g strong-cli

bajtos avatar May 28 '14 09:05 bajtos

I'm closing as no further activity shows up. Please reopen if it's still an issue for you.

raymondfeng avatar Jul 10 '14 04:07 raymondfeng

I found this problem in couple Ubuntu 14 servers using node.js 4.1.2 By default somehow slc is not created or not added to PATH. Solved this problem by adding symlink:

code sudo ln -s /usr/lib/node_modules/strongloop/bin/slc.js /usr/bin/slc

tmsnvd avatar Oct 27 '15 08:10 tmsnvd

All, please note that strongloop-specific tooling is no longer being maintained and that the lb cli tool provided by the loopback-cli project now "supersedes" strongloop's "older slc tool."

cmvee avatar Jun 18 '17 18:06 cmvee

I know this post is old but this solution did not fix my issue. What i did to resolve this issue is to make sure you are running power shell or Git Bash as an administrator. If you are on Ubuntu make sure you run SUDO

youngtk96 avatar Oct 19 '17 15:10 youngtk96