问题
I have installed Strongloop using npm install -g strongloop
on my Ubuntu 14.04 server. The slc
command does not work. It says
The program 'slc' is currently not installed. You can install it by typing:
sudo apt-get install heimdal-multidev
How can I get it to run the Strongloop CLI instead of looking for this package? I have added this to my PATH and it still doesn't work. Any ideas?
Other Strongloop commands, like sl-build
work and strongloop
is listed in npm list -g
.
回答1:
Ubuntu 14 with node.js 4.1.2
By default somehow slc is not created or not added to PATH. I solved this problem by adding symlink:
sudo ln -s /usr/lib/node_modules/strongloop/bin/slc.js /usr/bin/slc
回答2:
A soft link named slc
should have been created at /usr/local/bin which will point to strongloop
binary.
Please verify if the following exists.
/usr/local/lib/node_modules/strongloop/bin/slc
If no, then strongloop
did not get installed successfully, otherwise verify the existence of the softlink slc
at /usr/local/bin/
.
/usr/local/bin/slc -> /usr/local/lib/node_modules/strongloop/bin/slc
If yes, then /usr/local/bin
needs to be added to the $PATH
, otherwise create the softlink and verify that /usr/local/bin
in $PATH
.
回答3:
Looks like the Node installation that optionally comes with a Digital Ocean Droplet installs to a different location that's not in $PATH
. I'm pretty sure that was the issue. Anyways, I fixed it by spinning up a server without Node pre-installed and followed this guide. Just use npm install -g strongloop
instead of strong-cli
because the latter has been deprecated.
回答4:
Ubuntu 14.04 with node.js 4.4.2 (LTS) :
The installation of strongloop was done without any errors but slc was not added to the PATH. I solved this problem by adding the symlink:
sudo ln -s /usr/local/lib/node_modules/strongloop/bin/slc.js /usr/bin/slc
回答5:
Actually i am not sure my case matches with yours but i want to share my experience. i got the same message anyway.
I realized that i had changed prefix of global packets before. Then i checked prefix with the following command.
$ npm config get prefix /home/myUser/.node_modules_global
Then i added the path to PATH variable (but .profile, .bash_profile files will be better) in active command line window and problem solved.
来源:https://stackoverflow.com/questions/29222932/how-can-i-get-the-slc-command-to-work-on-ubuntu