How to properly run a npm script with arguments -


i've written small command line program nodejs , want able type npm run test , run program arguments below.

typing following command directly works, node.exe scrappee.js -u 'https://github.com/matutter/{}' -us 'cloggie, airrocks-flightcontroller' -s '$commit=li.commits > > span, $sha=.right .commit-tease-sha' -pm .\test\example_parse_module.js

but contents of package.json follows there no output whatsoever.

"scripts": {     "test" : "node.exe scrappee.js -u 'https://github.com/matutter/{}' -us 'cloggie, airrocks-flightcontroller' -s '$commit=li.commits > > span, $sha=.right .commit-tease-sha' -pm .\\test\\example_parse_module.js" } 

how can command npm run test run scrappee.js script these arguments?

the issue single quote ' being converted "'" npm when arguments forwarded, solution replace them double quotes below.

"test" : "node.exe scrappee.js -u \"https://github.com/matutter/{}\" -us \"cloggie, airrocks-flightcontroller\" -s \"$commit=li.commits > > span, $sha=.right .commit-tease-sha\" -pm \".\\test\\example_parse_module.js\"" 

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -