max-mapper / elementary-electron

NodeSchool workshop for learning Electron
228 stars 44 forks source link

Can't install this workshop. #8

Open ntlzz93 opened 8 years ago

ntlzz93 commented 8 years ago

I installed this workshop by npm install -g elementary-electron but this throw the error.

loint@Ntlzz:~$ npm install -g elementary-electron
npm ERR! tar.unpack untar error /home/loint/.npm/elementary-electron/1.3.3/package.tgz
npm ERR! Linux 3.19.0-59-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "elementary-electron"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! path /usr/local/lib/node_modules/elementary-electron
npm ERR! code EACCES
npm ERR! errno -13

npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/elementary-electron'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES, mkdir '/usr/local/lib/node_modules/elementary-electron']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/usr/local/lib/node_modules/elementary-electron',
npm ERR!   fstream_type: 'Directory',
npm ERR!   fstream_path: '/usr/local/lib/node_modules/elementary-electron',
npm ERR!   fstream_class: 'DirWriter',
npm ERR!   fstream_stack: 
npm ERR!    [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25',
npm ERR!      '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53',
npm ERR!      'FSReqWrap.oncomplete (fs.js:95:15)' ] }
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!     /home/loint/npm-debug.log
loint@Ntlzz:~$ npm install -g elementary-electron
npm ERR! tar.unpack untar error /home/loint/.npm/elementary-electron/1.3.3/package.tgz
npm ERR! Linux 3.19.0-59-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "elementary-electron"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! path /usr/local/lib/node_modules/elementary-electron
npm ERR! code EACCES
npm ERR! errno -13

npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/elementary-electron'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES, mkdir '/usr/local/lib/node_modules/elementary-electron']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/usr/local/lib/node_modules/elementary-electron',
npm ERR!   fstream_type: 'Directory',
npm ERR!   fstream_path: '/usr/local/lib/node_modules/elementary-electron',
npm ERR!   fstream_class: 'DirWriter',
npm ERR!   fstream_stack: 
npm ERR!    [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25',
npm ERR!      '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53',
npm ERR!      'FSReqWrap.oncomplete (fs.js:95:15)' ] }
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!     /home/loint/npm-debug.log

How to fix it?

ewnd9 commented 8 years ago

You need to change the global modules directory

$ npm config set prefix '~/.npm-packages'
$ echo 'export PATH="$PATH:$HOME/.npm-packages/bin"' >> ~/.bashrc
ntlzz93 commented 8 years ago

@ewnd9 :+1: