Spaceship-prompt: Install failing WSL (Ubuntu 16.04)

Created on 9 May 2017  ·  3Comments  ·  Source: denysdovhan/spaceship-prompt

Have issues trying to get this installed in the WSL (Ubuntu 16.04)

$ npm install -g spaceship-zsh-theme

npm WARN checkPermissions Missing write access to /usr/local/lib
/usr/local/lib
└── [email protected]

npm ERR! Linux 4.4.0-43-Microsoft
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "spaceship-zsh-theme"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! path /usr/local/lib
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access '/usr/local/lib'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES: permission denied, access '/usr/local/lib']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /mnt/c/Users/jason/npm-debug.log

With Sudo  /usr/local/lib/node_modules/spaceship-zsh-theme isn't valid, which is likely why ./install.zsh fails.

$ sudo npm install -g spaceship-zsh-theme

> [email protected] postinstall /usr/local/lib/node_modules/spaceship-zsh-theme
> ./install.zsh

sh: 1: ./install.zsh: Permission denied
npm ERR! Linux 4.4.0-43-Microsoft
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "spaceship-zsh-theme"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: `./install.zsh`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the [email protected] postinstall script './install.zsh'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the spaceship-zsh-theme package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ./install.zsh
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs spaceship-zsh-theme
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls spaceship-zsh-theme
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /mnt/c/Users/jason/npm-debug.log
[npm-debug.log.zip](https://github.com/denysdovhan/spaceship-zsh-theme/files/987651/npm-debug.log.zip)
question

Most helpful comment

if simple sudo won't do:

sudo npm i -g spaceship-prompt --unsafe-perm=true --allow-root

b/c of https://github.com/npm/npm/issues/17268

All 3 comments

This is also failing in Termux, same error as above with the sudo. Looks like the theme install bits aren't getting written to /usr/local/lib/node_modules.

Hey @jwhipp! Thanks for reaching out!

The problem is that you can't install npm package globally without sudo. The proper way is to fix npm permission and there is an awesome tutorial on npmjs.com called “03 — Fixing npm permission”.

Or if you're lazy, just use sudo:

sudo npm i -g spaceship-zsh-theme

I believe it'll help. Feel free to ask other questions, if you have.

if simple sudo won't do:

sudo npm i -g spaceship-prompt --unsafe-perm=true --allow-root

b/c of https://github.com/npm/npm/issues/17268

Was this page helpful?
0 / 5 - 0 ratings