ivan@pc:~$ npm i -g n
/home/ivan/.local/bin/n -> /home/ivan/.local/lib/node_modules/n/bin/n
n@2.0.2 /home/ivan/.local/lib/node_modules/n
ivan@pc:~$ echo export N_PREFIX=~/.local >> ~/.bashrc
ivan@pc:~$ . ~/.bashrc
ivan@pc:~$ n 4.0
/usr/bin/env: bash: Нет такого файла или каталога
ivan@pc:~$ n 4.2.2
/usr/bin/env: bash: Нет такого файла или каталога
ivan@pc:~$ node -v
Команда 'node' доступна в '/usr/bin/node'
Команда не может быть найдена, потому что '/usr/bin' не включена в переменную окружения PATH
node: команда не найдена
ivan@pc:~$
npm config set prefix ~/.local
export PATH=~/.local/bin:$PATH
ivan@pc:~$ npm remove bower
unbuild bower@1.6.5
ivan@pc:~$ npm i -g bower
/home/ivan/.local/bin/bower -> /home/ivan/.local/lib/node_modules/bower/bin/bower
bower@1.6.5 /home/ivan/.local/lib/node_modules/bower
ivan@pc:~$ bower -v
Error: EACCES, permission denied '/home/ivan/.config/configstore/bower-github.yml'
You don't have access to this file.
at Object.fs.openSync (evalmachine.<anonymous>:439:18)
at Object.fs.readFileSync (evalmachine.<anonymous>:290:15)
at Object.create.all.get (/home/ivan/.local/lib/node_modules/bower/node_modules/configstore/index.js:34:29)
at Object.Configstore (/home/ivan/.local/lib/node_modules/bower/node_modules/configstore/index.js:27:44)
at readCachedConfig (/home/ivan/.local/lib/node_modules/bower/lib/config.js:19:23)
at defaultConfig (/home/ivan/.local/lib/node_modules/bower/lib/config.js:11:12)
at Object.<anonymous> (/home/ivan/.local/lib/node_modules/bower/lib/index.js:40:32)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
ivan@pc:~$
ivan@pc:~$ npm config list
; cli configs
registry = "https://registry.npmjs.org/"
user-agent = "npm/1.4.28 node/v0.10.40 linux x64"
; userconfig /home/ivan/.npmrc
prefix = "/home/ivan/.local"
; node bin location = /usr/bin/node
; cwd = /home/ivan
; HOME = /home/ivan
; 'npm config ls -l' to show all defaults.
ivan@pc:~$
ivan@pc:~$ echo $PATH
/home/ivan/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
ivan@pc:~$
ivan@pc:~$ npm i bower
bower@1.6.5 node_modules/bower
ivan@pc:~$ bower -v
bower: команда не найдена
ivan@pc:~$
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install nodejs
sudo apt-get install build-essential
ivan@pc:~$ npm -v
1.4.28
ivan@pc:~$ npm install --global bower
npm ERR! Error: EACCES, unlink '/usr/bin/bower'
npm ERR! { [Error: EACCES, unlink '/usr/bin/bower'] errno: 3, code: 'EACCES', path: '/usr/bin/bower' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.19.0-33-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "--global" "bower"
npm ERR! cwd /home/ivan
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
npm ERR! path /usr/bin/bower
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, unlink '/usr/bin/bower'
npm ERR! error rolling back Error: EACCES, unlink '/usr/bin/bower'
npm ERR! error rolling back { [Error: EACCES, unlink '/usr/bin/bower'] errno: 3, code: 'EACCES', path: '/usr/bin/bower' }
npm ERR! not ok code 0
ivan@pc:~$ bower -v
Error: EACCES, permission denied '/home/ivan/.config/configstore/bower-github.yml'
You don't have access to this file.
at Object.fs.openSync (evalmachine.<anonymous>:439:18)
at Object.fs.readFileSync (evalmachine.<anonymous>:290:15)
at Object.create.all.get (/usr/lib/node_modules/bower/node_modules/configstore/index.js:34:29)
at Object.Configstore (/usr/lib/node_modules/bower/node_modules/configstore/index.js:27:44)
at readCachedConfig (/usr/lib/node_modules/bower/lib/config.js:19:23)
at defaultConfig (/usr/lib/node_modules/bower/lib/config.js:11:12)
at Object.<anonymous> (/usr/lib/node_modules/bower/lib/index.js:40:32)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
ivan@pc:~$ sudo bower -v
[sudo] password for ivan:
1.6.5
ivan@pc:~$ sudo npm remove --dave-dev --global bower
unbuild bower@1.6.5
ivan@pc:~$ sudo bower -v
sudo: bower: command not found
ivan@pc:~$ npm install -g bower
npm ERR! Error: EACCES, mkdir '/usr/lib/node_modules/bower'
npm ERR! { [Error: EACCES, mkdir '/usr/lib/node_modules/bower']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/lib/node_modules/bower',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/lib/node_modules/bower',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR! '/usr/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53',
npm ERR! 'Object.oncomplete (fs.js:108:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.19.0-33-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "bower"
npm ERR! cwd /home/ivan
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
npm ERR! path /usr/lib/node_modules/bower
npm ERR! fstream_path /usr/lib/node_modules/bower
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/lib/node_modules/bower'
npm ERR! fstream_stack /usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53
npm ERR! fstream_stack Object.oncomplete (fs.js:108:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ivan/npm-debug.log
npm ERR! not ok code 0
ivan@pc:~$ sudo bower -v
sudo: bower: command not found
ivan@pc:~$ bower -v
bash: /usr/bin/bower: Нет такого файла или каталога
ivan@pc:~$
ivan@pc:~$ sudo bower -v
sudo: bower: command not found
ivan@pc:~$ bower -v
bash: /usr/bin/bower: Нет такого файла или каталога
ivan@pc:~$ npm -v
1.4.28
ivan@pc:~$ npm install -g bower
npm ERR! Error: EACCES, mkdir '/usr/lib/node_modules/bower'
npm ERR! { [Error: EACCES, mkdir '/usr/lib/node_modules/bower']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/lib/node_modules/bower',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/lib/node_modules/bower',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR! '/usr/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53',
npm ERR! 'Object.oncomplete (fs.js:108:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.19.0-33-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "bower"
npm ERR! cwd /home/ivan
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
npm ERR! path /usr/lib/node_modules/bower
npm ERR! fstream_path /usr/lib/node_modules/bower
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/lib/node_modules/bower'
npm ERR! fstream_stack /usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53
npm ERR! fstream_stack Object.oncomplete (fs.js:108:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ivan/npm-debug.log
npm ERR! not ok code 0
ivan@pc:~$
Оказалось что в .bashrc строки склеились
сделал вот так
установка вроде прошла но версия не изменилась -