0

I try to install it via sudo npm install -g ldf-server But it gives me error:

/usr/bin/ldf-server -> /usr/lib/node_modules/ldf-server/bin/ldf-server

> hdt@1.5.0 install /usr/lib/node_modules/ldf-server/node_modules/hdt
> node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/10.10.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/ldf-server/node_modules/hdt/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/ldf-server/node_modules/hdt/.node-gyp'
gyp ERR! System Linux 4.9.0-8-amd64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/ldf-server/node_modules/hdt
gyp ERR! node -v v10.10.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: hdt@1.5.0 (node_modules/ldf-server/node_modules/hdt):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: hdt@1.5.0 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ ldf-server@2.2.3
updated 1 package in 1.512s

I tried the above command on a local machine (Ubuntu) it works fine.

apt update and apt upgrade gives me an empty list for packages.

So when I try to installed the npm via apt I followed instructions from https://stackoverflow.com/a/48006814/646732

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -

Is there something similar I need to do for npm?

  • Please set - npm config set python /usr/bin/python2.6 and npm config set unsafe-perm true and try again. – sanjayparmar Sep 18 '18 at 5:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.