Troubleshooting topojson on ubuntu

I am trying to install topojson following the instructions of Mike Bostock Let Make a Map http://bost.ocks.org/mike/map/ and I believe that I managed to get the latest version of Node.js and npm. $ which runs ogr2ogr. I am completely new to programming and Ubuntu and sincerely appreciate some thorough help regarding why npm install topojson -g gives the following errors. When I try to run the same command with sudo, it gives errors like: npm ERR! json and gyp ERR registry error analysis! stack Error: "pre" node versions cannot be installed, use the --nodedir flag instead

Thanks!

npm ERR! Error: EACCES, open '/home/natecraft/.npm/7edf76d6-topojson.lock' npm ERR! { [Error: EACCES, open '/home/natecraft/.npm/7edf76d6-topojson.lock'] npm ERR! errno: 3, npm ERR! code: 'EACCES', npm ERR! path: '/home/natecraft/.npm/7edf76d6-topojson.lock' } npm ERR! npm ERR! Please try running this command again as root/Administrator. npm ERR! System Linux 3.5.0-23-generic npm ERR! command "/home/natecraft/.nvm/v0.10.15/bin/node" "/home/natecraft/.nvm/v0.10.15/bin/npm" "install" "topojson" "-g" npm ERR! cwd /home/natecraft/Downloads/node-latest-install npm ERR! node -v v0.10.15 npm ERR! npm -v 1.3.5 npm ERR! path /home/natecraft/.npm/7edf76d6-topojson.lock npm ERR! code EACCES npm ERR! errno 3 npm ERR! stack Error: EACCES, open '/home/natecraft/.npm/7edf76d6-topojson.lock' npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/natecraft/Downloads/node-latest-install/npm-debug.log npm ERR! not ok code 0 
+6
source share
2 answers

Check the version of node.js first - use the stable version, not the devel version. Second, call the npm command as root.

 $ sudo npm install -g topojson 

So far, when I switched my node.js to the stable version, installing TopoJSON works well. Thank you for attention.

+4
source

I encountered this error when installing topojson (Debian 3.2.0-4-amd64). My steps to get things working (also discussed here ).

Install node v 0.11.10

 git clone https://github.com/joyent/node.git cd node git checkout v0.11.10 ./configure && make sudo make install 

Uninstall debian gyp and install via npm:

 sudo apt-get remove gyp npm install -g gyp 

Explicit context setting, although this was already an installed version.

 npm install contextify@0.1.7 

then topojson installation should work

 sudo npm install -g topojson 
+2
source

Source: https://habr.com/ru/post/950992/


All Articles