3
votes

Im using Mac OS X 10.10.2 .
node -v v0.12.1 npm -v 2.5.1 Installing the strongloop Package via npm install -g strongloop worked only with sudo even when i fixed the permission rights via
$ sudo chown -R $USER /usr/local/bin $ sudo chown -R $USER /usr/local/lib/node_modules Without sudo it throws EACCS error“s http://pastebin.com/uJbjbXG3

/usr/local/bin/npm/node_modules/strongloop/bin/slc exists. Any thoughts?

4
You shouldn't change permissions/ownership on system folders, like /usr/local/bin. - baf
Some systems will require sudo priveleges to install any global package... have been able to install anything else using npm install -g without using sudo? - Jordan Kasper

4 Answers

1
votes

Based on the last lines of your error message:

113 error error rolling back Error: EACCES, unlink '/Users/Simon/npm/bin/slc'
113 error error rolling back     at Error (native)
113 error error rolling back  { [Error: EACCES, unlink '/Users/Simon/npm/bin/slc'] errno: -13, code: 'EACCES', path: '/Users/Simon/npm/bin/slc' }

It appears that you may have configured npm to use a non-standard prefix, because it is installing strongloop to a /Users/Simon/npm instead of /usr/local.

Based on your problem description, /usr/local/bin/npm is a directory (or a symlink to a directory) instead of a file, which is not useful.

I'm not sure what method you used for installing node and npm, but it appears to have gone horribly wrong.

At the very least, you should probably do sudo chown -R Simon ~/npm so that you can once again write to the directories and files that are inside your $HOME.

If this is your first time using node and you don't have any other modules installed, you may find it easier to use something like nvm to install node and npm in a way that does not require sudo.

0
votes

I must to warn that this is a poor solution because you won't want to have all strongloop framework inside your project I just put this answer with explanatory purposes.

Hi there (if you don't want make a globally installation)

My problem was some similar, CLI throw me the same message:

SLC command not found

But I realized that I made a local installation of strongloop, I mean installed stronloop with the following command

npm install strongloop

Maybe you can put the full path to find the slc executable:

node node_modules/strongloop/bin/slc arc 

Or you would like to make the job in a straightforward way, adding the following line to package.json (inside scripts section):

"slc": "node node_modules/strongloop/bin/slc"

And then, type in your console:

npm run-script slc arc
0
votes

Some fresh research shows that StrongLoop-specific tooling (to include the slc tool) is no longer maintained since the company was purchased by IBM. Loopback itself is actively maintained.

The loopback-cli project specifically mentions that it provides an lb command-line tool that "supersedes" strongloop's "older slc tool."

-2
votes

As mentioned in a reply to an possible solution. Here is my solution npm config set prefix /usr/local