Install SKPM (Sketch Plugin Manager) via npm

I am trying to install an npm package that throws a bunch of bugs that I am not very familiar with. Keep in mind that these errors are executed aftersudo npm install -g skpm :

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/skpm/node_modules/keytar/build'
gyp ERR! System Darwin 17.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/skpm/node_modules/keytar
gyp ERR! node -v v8.9.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! keytar@4.1.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the keytar@4.1.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/USERNAME/.npm/_logs/2017-12-19T01_53_44_910Z-debug.log

Initially, I thought that I needed to install keytar to do this work, but after installation I still had the same errors.

+4
source share
3 answers

I found a question about why skpm was not installed.

Make sure you install x-code + command line tools

This fixed the issue and SCPM.

+1
source

Avoid usingsudo npm -g install During gyp compilation you will have such problems again and again. Permissions for commit is a solution.

npm docs:

, :

  • npm .
  • npm .
  • Node , . , , .

1: npm

npm: npm config get prefix /usr/local.

. - /usr, 2 .

npm ( !):

sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}

, npm (lib/ node_modules, bin share).

2: npm

, default, npm (,/usr), , , .

npm . .

:

mkdir ~/.npm-global

npm :

npm config set prefix '~/.npm-global'

~/.profile :

export PATH=~/.npm-global/bin:$PATH

:

source ~/.profile

. sudo.

npm install -g jshint

2-4 ENV (, ~/.profile):

NPM_CONFIG_PREFIX=~/.npm-global

3. , .

Node Mac OS, Homebrew. Homebrew .

brew install node

+2

usually EACCES: permission deniedan attempt is made to install the package globally (with -g) without granting permissions. Suppose you are on os with sudo, try calling

sudo npm install -g skpm

or if you do not want it to be global

npm install skpm
+1
source

Source: https://habr.com/ru/post/1691001/


All Articles