can't install due to mmmagic
On Lubuntu Zesty:
sudo npm install -g apaste
/usr/local/bin/apaste -> /usr/local/lib/node_modules/apaste/upclient.js
> mmmagic@0.4.5 install /usr/local/lib/node_modules/apaste/node_modules/mmmagic
> node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/apaste/node_modules/mmmagic/
build' gyp ERR! stack at Error (native)
gyp ERR! System Linux 4.10.0-38-generic
gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuil
d" gyp ERR! cwd /usr/local/lib/node_modules/apaste/node_modules/mmmagic
gyp ERR! node -v v6.12.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mmmagic@0.4.5 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mmmagic@0.4.5 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/wxl/.npm/_logs/2017-11-17T06_47_46_952Z-debug.log
How does one get a permission denied as root? I mean, yes, there are ways, not absolutely not relevant here. In fact, I can sudo mkdir /usr/local/lib/node_modules/apaste/node_modules/mmmagic/build
with no problems.
Here's the tail of the log:
1845 silly install mmmagic@0.4.5
1846 info lifecycle mmmagic@0.4.5~install: mmmagic@0.4.5
1847 verbose lifecycle mmmagic@0.4.5~install: unsafe-perm in lifecycle false
1848 verbose lifecycle mmmagic@0.4.5~install: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/usr/local/lib/node_modules/apaste/node_modules/mmmagic/node_modules/.bin:/usr/local/lib/node_modules/apaste/node_modules/.bin:/usr/local/lib/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
1849 verbose lifecycle mmmagic@0.4.5~install: CWD: /usr/local/lib/node_modules/apaste/node_modules/mmmagic
1850 silly lifecycle mmmagic@0.4.5~install: Args: [ '-c', 'node-gyp rebuild' ]
1851 silly lifecycle mmmagic@0.4.5~install: Returned: code: 1 signal: null
1852 info lifecycle mmmagic@0.4.5~install: Failed to exec install script
1853 verbose unlock done using /home/wxl/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
1854 verbose stack Error: mmmagic@0.4.5 install: `node-gyp rebuild`
1854 verbose stack Exit status 1
1854 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
1854 verbose stack at emitTwo (events.js:106:13)
1854 verbose stack at EventEmitter.emit (events.js:191:7)
1854 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
1854 verbose stack at emitTwo (events.js:106:13)
1854 verbose stack at ChildProcess.emit (events.js:191:7)
1854 verbose stack at maybeClose (internal/child_process.js:920:16)
1854 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
1855 verbose pkgid mmmagic@0.4.5
1856 verbose cwd /home/wxl
1857 verbose Linux 4.10.0-38-generic
1858 verbose argv "/usr/bin/node" "/usr/local/bin/npm" "install" "-g" "apaste"
1859 verbose node v6.12.0
1860 verbose npm v5.5.1
1861 error code ELIFECYCLE
1862 error errno 1
1863 error mmmagic@0.4.5 install: `node-gyp rebuild`
1863 error Exit status 1
1864 error Failed at the mmmagic@0.4.5 install script.
1864 error This is probably not a problem with npm. There is likely additional logging output above.
1865 verbose exit [ 1, true ]
I've tried removing and reinstalling and no matter what it fails. Any ideas would be greatly appreciated.