Skip to content

Instantly share code, notes, and snippets.

@clintharris
Created December 2, 2011 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clintharris/1424873 to your computer and use it in GitHub Desktop.
Save clintharris/1424873 to your computer and use it in GitHub Desktop.
Using .cmd script hack with NPM package.json on Windows
Z:\dev\xos_script_test>node --version
v0.6.3
Z:\dev\xos_script_test>npm --version
1.1.0-alpha-2
Z:\dev\xos_script_test>echo %PATHEXT%
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
Z:\dev\xos_script_test>type package.json
{
"name": "xos_script_test",
"description": "A test for running cross-os scripts",
"version": "0.0.1",
"scripts": {
"test": "./bin/my_script"
}
}
Z:\dev\xos_script_test>type .\bin\my_script.cmd
dir
Z:\dev\xos_script_test>npm test
> xos_script_test@0.0.1 test Z:\dev\xos_script_test
> ./bin/my_script
'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! xos_script_test@0.0.1 test: `./bin/my_script`
npm ERR! `cmd "/c" "./bin/my_script"` failed with 1
npm ERR!
npm ERR! Failed at the xos_script_test@0.0.1 test script.
npm ERR! This is most likely a problem with the xos_script_test package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./bin/my_script
npm ERR! You can get their info via:
npm ERR! npm owner ls xos_script_test
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Windows_NT 5.1.2600
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "test"
npm ERR! cwd Z:\dev\xos_script_test
npm ERR! node -v v0.6.3
npm ERR! npm -v 1.1.0-alpha-2
npm ERR! code ELIFECYCLE
npm ERR! message xos_script_test@0.0.1 test: `./bin/my_script`
npm ERR! message `cmd "/c" "./bin/my_script"` failed with 1
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! Z:\dev\xos_script_test\npm-debug.log
npm not ok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment