Installing mattermost-redux for a global package fails
marklagendijk opened this issue · comments
Summary
Installation of mattermost-redux fails due to git dependency.
Steps to reproduce
- sudo npm i -g mattermost-redux
Expected behavior
The module should install without error.
The issue occurs if you want to install a package (for example an cli) which uses mattermost-redux globally.
Observed behavior
npm ERR! code 128
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b master https://github.com/enahum/redux-offline.git /root/.npm/_cacache/tmp/git-clone-f7f32218
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-f7f32218': Permission denied
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-02-12T14_40_06_244Z-debug.log
Possible fixes
- Remove the
redux-offline
dependency as git based dependency. If you must use your own version of this package, at least publish it to npm. - Split
mattermost-redux
into different packages. The idea with npm is that packages are small. This package now contains both the client and usages of the client. I propose to at least createmattermost-http-client
andmattermost-ws-client
as packages. Note: you can still keep the code in one repo.
@marklagendijk after reading the error output looks like you have permissions issues to install it in that folder
@enahum that is correct.
However, this issue happens with the default way Node.js is installed on Ubuntu / Debian systems, when installing git based dependencies.
The git dependencies have two issues that normal dependencies don't have:
- They require
git
to be installed on the system. - They don't work with the default way Node.js is installed on Ubuntu / Debian.
The background of this is that I'm making a simple Node.js mattermost-cli
tool to send Mattermost chat messages from our Jenkins server.
The tool works, but these two issues prevent me from installing it on the Jenkins builders.