Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User guide: improve installation instructions for Linux #396

Closed
okkhoy opened this issue Jul 30, 2018 · 3 comments · Fixed by #948
Closed

User guide: improve installation instructions for Linux #396

okkhoy opened this issue Jul 30, 2018 · 3 comments · Fixed by #948

Comments

@okkhoy
Copy link

okkhoy commented Jul 30, 2018

Tell us about your environment
Ubuntu 18.04

  • MarkBind Version:

1.10.0

What did you do? Please include the actual source code causing the issue.

On execution the command : sudo npm install -g markbind-cli from the terminal, I get the following error:

anarayan@BuntuBox:~$ sudo npm install -g markbind-cli
npm ERR! code 1
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b v3.10.0-markbind.1 git://github.com/MarkBind/htmlparser2.git /home/anarayan/.npm/_cacache/tmp/git-clone-95c44500
npm ERR! /home/anarayan/.npm/_cacache/tmp/git-clone-95c44500/.git: Permission denied
npm ERR! 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/anarayan/.npm/_logs/2018-07-30T14_38_48_364Z-debug.log

Next I tried npm install -g markbind-cli without sudo
That errors out as follows:

anarayan@BuntuBox:~$  npm install -g markbind-cli
npm WARN checkPermissions Missing write access to /usr/lib/node_modules
npm ERR! path /usr/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR!  { Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR!   stack: 'Error: EACCES: permission denied, access \'/usr/lib/node_modules\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/lib/node_modules' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

┌────────────────────────────────────────────────────────────┐
│                  npm update check failed                   │
│            Try running with sudo or get access             │
│            to the local update config store via            │
│ sudo chown -R $USER:$(id -gn $USER) /home/anarayan/.config │
└────────────────────────────────────────────────────────────┘

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/anarayan/.npm/_logs/2018-07-30T14_39_27_950Z-debug.log

Installation goes through now with sudo

anarayan@BuntuBox:~$ sudo npm install -g markbind-cli
npm WARN notice [SECURITY] string has the following vulnerability: 1 high. Go here for more details: https://nodesecurity.io/advisories?search=string&version=3.3.3 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] debug has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=debug&version=2.2.0 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
/usr/bin/markbind -> /usr/lib/node_modules/markbind-cli/index.js

> [email protected] postinstall /usr/lib/node_modules/markbind-cli/node_modules/nunjucks
> node postinstall-build.js src

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/markbind-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ [email protected]
added 413 packages in 25.629s

The exact same sequence of outcomes happened on Ubuntu 16.04 (Virtual Machine) as well.

Not sure if it is markbind issue or npm; feel free to close this issue if it is not markbind related.

What did you expect to happen?

What actually happened? Please include the actual, raw output.

@yamgent
Copy link
Member

yamgent commented Jul 31, 2018

If you type npm list -g, does the first line say usr/lib?

Can reproduce this issue when npm is configured to install packages in usr/lib (this is the directory used if Node.js is installed this way).

I was able to fix this problem by configuring npm to install stuff in ~/.npm-global, which doesn't require messing around with permissions. The instructions can be found on the npmjs docs here.

@yamgent
Copy link
Member

yamgent commented Jul 31, 2018

While it is not a MarkBind problem, I think the user guide can be edited to mention the appropriate solution under the installation instructions section, since I suspect this will be a common issue to Linux users.

@okkhoy
Copy link
Author

okkhoy commented Aug 4, 2018

@yamgent Thanks for the links! Yes, I installed using the package manager. I have now set the default npm directory to a location that is more permissive.

@yamgent yamgent changed the title Installation is messy on Linux User guide: improve installation instructions for Linux Dec 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants