pixiedust_node icon indicating copy to clipboard operation
pixiedust_node copied to clipboard

Running npm package in cell like one would do on command line

Open bazini627 opened this issue 7 years ago • 2 comments

Is it possible to run a npm package within a cell after it's been installed like you would from the command line? I have installed shp2json with npm.install('shp2json') and would like to then run it with !shp2json /path/to/shapefile > output.json but receive an error saying /bin/sh: 1: shp2json: not found

bazini627 avatar Jan 31 '19 07:01 bazini627

Not at the moment @bazini627. The npm modules are installed for development, so any binary executables are not added to the path.

This is where you'd find installed npm modules, if you want to use absolute paths to the executables:

https://github.com/pixiedust/pixiedust_node/blob/master/pixiedust_node/node.py#L155-L159

glynnbird avatar Feb 04 '19 16:02 glynnbird

I am not sure if this would change anything or help but couldn't you instead run !npm install shp2json -g and then access it like you would normally so

!shp2json /path/to/shapefile > output.json

twosdai avatar Apr 07 '20 00:04 twosdai