M
M
Maxim Kononov2018-03-01 11:38:18
Node.js
Maxim Kononov, 2018-03-01 11:38:18

How to fix iconv installation error from npm (Ubuntu)?

$ sudo npm i iconv

> [email protected] install /home/max/node_modules/iconv
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/max/node_modules/iconv/build'
gyp ERR! System Linux 4.4.0-116-generic
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 /home/max/node_modules/iconv
gyp ERR! node -v v9.6.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN enoent ENOENT: no such file or directory, open '/home/max/package.json'
npm WARN spam No description
npm WARN spam No repository field.
npm WARN spam No README data
npm WARN spam No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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!     /home/max/.npm/_logs/2018-03-01T08_34_32_493Z-debug.log

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Skibin, 2018-03-01
@megafax

It seems to be clearly written
Find out who you're running from

E
Egor Zhivagin, 2018-03-01
@Krasnodar_etc

Have you tried without sudo? Check directory permissions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question