I'm trying to understand how executables can be run after installing a module using the JSPM. For instance if I run jspm install gulp
, then I would expect to be able to run the following command:
./jspm_packages/npm/gulp\@3.8.11/bin/gulp.js
Actually it would be better if jspm would handle this so that there is a hidden bin directory containing all retrieved executables (such as gulp) at the following location:
./jspm_packages/.bin
That way I could just have a single addition to my PATH environment variable that would allow these executables to run.
Currently when I attempt to run a jspm-installed gulp, I get the following error message:
[jspm-test]$ ./jspm_packages/npm/gulp\@3.8.11/bin/gulp.js
./jspm_packages/npm/[email protected]/bin/gulp.js: line 1: /bin: Is a directory
./jspm_packages/npm/[email protected]/bin/gulp.js: line 2: syntax error near unexpected token `('
./jspm_packages/npm/[email protected]/bin/gulp.js: line 2: `(function(process) {'
Is there some other way I should be going about this?
In my experience this is weird with JSPM as JSPM is more geared towards deps for your app that are actually in production in the browser. What I do in my projects is install modules I need to run with scripts/in dev (gulp, karma, express etc) using NPM, then you can run them with node:
node ./node_modules/karma/bin/karma.js <args>
It's kind of weird, but if you think of it as NPM handling local, "executable" deps that aren't used in production and JSPM handling the deps for your application that are going to get bundled and shipped it makes sense.