I am using Vagrant to run the default linux VM (with admin privilleges so that symlink works)
After installing a package with npm install -g <package>
, I am unable to run the symlink created (as a shortcut to run from path).
The file contents as follows:
#!/usr/bin/env node
var arguments = process.argv.slice(2);
var fs = require('fs');
var usage = fs.readFileSync(__dirname + '/usage.txt').toString();
if (arguments.length < 3) {
console.error(usage);
return;
}
var summon = require('./Summoner');
summon(arguments[0], arguments[1], arguments[2]);
Running the file with <filename>
directly doesn't work, throwing : No such file or directory
, whereas running it with node <filename>
will work.
I have tried npm install -g gulp
and running gulp
works perfectly. Checking the contents of gulp
, I see that the #!/usr/bin/env node
line is exactly the same as this file, so what am I missing here?