Pure: Installation issue on Ubuntu 14.04

Created on 25 Aug 2017  Β·  9Comments  Β·  Source: sindresorhus/pure

General information

  • Pure version: 1.5.2
  • ZSH version: 5.4.2
  • Terminal program & version: terminator 0.97
  • Operating system: Ubuntu 14.04
  • ZSH framework: oh-my-zsh

I have:

  • [x] Tested with another terminal program and can reproduce the issue:hyper terminal
  • [x] Followed the Integration instructions for my framework

Problem description

[email protected] postinstall /usr/local/lib/node_modules/pure-prompt
PURE_DEST=/usr/local/share/zsh/site-functions npm run --silent postinstall-link && exit 0; PURE_DEST="$PWD/functions" npm run postinstall-link && npm run postinstall-fail-instructions

ln: impossible de crΓ©er le lien symbolique Β«/usr/local/share/zsh/site-functions/prompt_pure_setupΒ»: Permission non accordΓ©e

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ 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/dev/.config β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

[email protected] postinstall-link /usr/local/lib/node_modules/pure-prompt
mkdir -p "$PURE_DEST" && ln -sf "$PWD/pure.zsh" "$PURE_DEST/prompt_pure_setup" && ln -sf "$PWD/async.zsh" "$PURE_DEST/async"

mkdir: impossible de crΓ©er le rΓ©pertoire Β«/usr/local/lib/node_modules/pure-prompt/functionsΒ»: Permission non accordΓ©e
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall-link: mkdir -p "$PURE_DEST" && ln -sf "$PWD/pure.zsh" "$PURE_DEST/prompt_pure_setup" && ln -sf "$PWD/async.zsh" "$PURE_DEST/async"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall-link script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ 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/dev/.config β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

npm ERR! A complete log of this run can be found in:
npm ERR! /home/dev/.npm/_logs/2017-08-25T11_11_25_184Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: PURE_DEST=/usr/local/share/zsh/site-functions npm run --silent postinstall-link && exit 0; PURE_DEST="$PWD/functions" npm run postinstall-link && npm run postinstall-fail-instructions
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall 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/dev/.npm/_logs/2017-08-25T11_11_25_270Z-debug.log

Reproduction steps

launch the npm install command

My .zshrc:

autoload -U promptinit; promptinit
prompt pure

Most helpful comment

try this
npm install --global pure-prompt --allow-root --unsafe-perm=true

All 9 comments

This seems similar to #341. No idea why it's failing.

Can you post the full output of: ls -lha /usr/local/lib/node_modules/pure-prompt ?

I have the same issue.

The full output of ls -lha /usr/local/lib/node_modules/pure-prompt is:

ls: cannot access '/usr/local/lib/node_modules/pure-prompt': No such file or directory

@LitoMore was your error identical to what @hyphaene had (e.g. same folders, etc)?

  • Where is npm installing pure for you?
  • How do we figure out the correct directory?

The current installation script relies on $PWD being the directory where pure was installed.

Sorry, my mistake, I forgot my node_modules is in the /usr/lib. NOT /usr/local/lib.

The full output of ls -lha /usr/lib/node_modules/pure-prompt is:

ls: cannot access '/usr/lib/node_modules/pure-prompt': No such file or directory

Where is npm installing pure for you?

/usr/lib/node_modules/pure-prompt

My info:

  • Pure version: 1.5.2
  • Zsh version: zsh 5.1.1 (x86_64-ubuntu-linux-gnu)
  • Zsh framework: oh-my-zsh
  • Terminal program & version: iTerm2 Build 3.1.beta.8
  • Node version: 8.4.0
  • NPM version: 5.3.0
  • OS: Ubuntu 16.04
  • User: root
  • echo $PWD: /root
  • [x] Tested with another terminal program and can reproduce the issue:hyper terminal
  • [x] Followed the Integration instructions for my framework

This is my output of npm i -g pure-prompt:

> [email protected] postinstall /usr/lib/node_modules/pure-prompt
> PURE_DEST=/usr/local/share/zsh/site-functions npm run --silent postinstall-link && exit 0; PURE_DEST="$PWD/functions" npm run postinstall-link && npm run postinstall-fail-instructions

glob error { Error: EACCES: permission denied, scandir '/root/.npm/_logs'
  stack: 'Error: EACCES: permission denied, scandir \'/root/.npm/_logs\'',
  errno: -13,
  code: 'EACCES',
  syscall: 'scandir',
  path: '/root/.npm/_logs' }

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              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) /root/.config β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
npm ERR! path /root/.npm/_logs
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall scandir
npm ERR! Error: EACCES: permission denied, scandir '/root/.npm/_logs'
npm ERR!  { Error: EACCES: permission denied, scandir '/root/.npm/_logs'
npm ERR!   stack: 'Error: EACCES: permission denied, scandir \'/root/.npm/_logs\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'scandir',
npm ERR!   path: '/root/.npm/_logs' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
glob error { Error: EACCES: permission denied, scandir '/root/.npm/_logs'
  stack: 'Error: EACCES: permission denied, scandir \'/root/.npm/_logs\'',
  errno: -13,
  code: 'EACCES',
  syscall: 'scandir',
  path: '/root/.npm/_logs' }

> [email protected] postinstall-link /usr/lib/node_modules/pure-prompt
> mkdir -p "$PURE_DEST" && ln -sf "$PWD/pure.zsh" "$PURE_DEST/prompt_pure_setup" && ln -sf "$PWD/async.zsh" "$PURE_DEST/async"

mkdir: cannot create directory β€˜/usr/lib/node_modules/pure-prompt/functions’: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall-link: `mkdir -p "$PURE_DEST" && ln -sf "$PWD/pure.zsh" "$PURE_DEST/prompt_pure_setup" && ln -sf "$PWD/async.zsh" "$PURE_DEST/async"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall-link script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              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) /root/.config β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
npm ERR! code ELIFECYCLE
npm ERR! errno 243
npm ERR! [email protected] postinstall: `PURE_DEST=/usr/local/share/zsh/site-functions npm run --silent postinstall-link && exit 0; PURE_DEST="$PWD/functions" npm run postinstall-link && npm run postinstall-fail-instructions`
npm ERR! Exit status 243
npm ERR!
npm ERR! Failed at the [email protected] postinstall 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!     /root/.npm/_logs/2017-08-31T11_31_47_991Z-debug.log

@LitoMore are you installing as root (e.g. via sudo)? If so, that's probably the issue. Take a look at the issues I've linked to here: https://github.com/sindresorhus/pure/issues/341#issuecomment-326000184.

@mafredri Yes, is root.

Thanks.

Any update on this?

try this
npm install --global pure-prompt --allow-root --unsafe-perm=true

Closing due to age.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ianchesal picture ianchesal  Β·  3Comments

Hotschke picture Hotschke  Β·  8Comments

rawaludin picture rawaludin  Β·  3Comments

julenpardo picture julenpardo  Β·  5Comments

tyrollins picture tyrollins  Β·  4Comments