Can't run riot commands in Windows #1605

Closed
jobrodesign opened this Issue Feb 17, 2016 · 6 comments

Projects

None yet

3 participants

@jobrodesign

Version 2.2.4 ran just fine from the command line in Windows, but since breaking up riot into separate packages (riot-cli, riot-compiler, etc) the only way to precompile tags has been through the grunt-riot module. I have seen a few issues raised and closed seemingly due to other issues.

In Issue #1337 the reporter stated "I set the path directly to /.bin/riot.cmd and now it doesn't work with
babel." the fix wasn't just changing his version of babel, but also making some edit to paths in either .bin/riot or .bin/riot.cmd

if you compare .bin/riot and .bin/riot.cmd from 2.2.4 and 2.3.15 you'll see a significant difference in paths

below is the npm debug log when attempting to run 'riot tags tags/tags.js' as an npm script

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run-script',
1 verbose cli   'riot' ]
2 info using npm@2.14.7
3 info using node@v4.2.1
4 verbose run-script [ 'preriot', 'riot', 'postriot' ]
5 info preriot opui-tags@1.0.0
6 info riot opui-tags@1.0.0
7 verbose unsafe-perm in lifecycle true
8 info opui-tags@1.0.0 Failed to exec riot script
9 verbose stack Error: opui-tags@1.0.0 riot: `riot tags tags/tags.js`
9 verbose stack Exit status 1
9 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:214:16)
9 verbose stack     at emitTwo (events.js:87:13)
9 verbose stack     at EventEmitter.emit (events.js:172:7)
9 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
9 verbose stack     at emitTwo (events.js:87:13)
9 verbose stack     at ChildProcess.emit (events.js:172:7)
9 verbose stack     at maybeClose (internal/child_process.js:818:16)
9 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid opui-tags@1.0.0
11 verbose cwd C:\Users\Joshua\dev\opui-tags
12 error Windows_NT 10.0.10586
13 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run-script" "riot"
14 error node v4.2.1
15 error npm  v2.14.7
16 error code ELIFECYCLE
17 error opui-tags@1.0.0 riot: `riot tags tags/tags.js`
17 error Exit status 1
18 error Failed at the opui-tags@1.0.0 riot script 'riot tags tags/tags.js'.
18 error This is most likely a problem with the opui-tags package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error     riot tags tags/tags.js
18 error You can get their info via:
18 error     npm owner ls opui-tags
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
@GianlucaGuarini
Member

@jobrodesign can you post your code somewhere? I will try to have a look. I am not sure it's a riot issue.
Have you tried updating npm?

@jobrodesign

Yep running npm v2.14.7 and node v4.2.1

notice the differences in riot 2.3.15

from node_modules/.bin/riot (2.3.15)

if [ -x "$basedir//bin/sh" ]; then
  "$basedir//bin/sh"  "$basedir/../riot/node_modules/.bin/riot" "$@"
  ret=$?
else 
  /bin/sh  "$basedir/../riot/node_modules/.bin/riot" "$@"
  ret=$?

from node_modules/.bin/riot (2.2.4)

if [ -x "$basedir/node" ]; then
  "$basedir/node"  "$basedir/../riot/lib/server/cli.js" "$@"
  ret=$?
else 
  node  "$basedir/../riot/lib/server/cli.js" "$@"
  ret=$?

These references to bin/sh arent going to work in a windows environment, right?

Another potential avenue might be in the node_modules/riot/package.json
from 2.3.15

"bin": {
    "riot": "node_modules/.bin/riot"
  }

from 2.2.4

"bin": {
    "riot": "lib/server/cli.js"
  }
@GianlucaGuarini
Member

@jobrodesign do you still have problems installing npm install riot-cli -g?

@jobrodesign

Yep, it does work for me so long as riot-cli is installed globally. Also riot cannot be installed locally in the package otherwise npm will attempt to use the locally available riot dependency when attempting to run a script. Ideally, riot could be installed locally, but its not the only project out there that needs to be installed globally. Thanks for your help

@aMarCruz
Member

I think the "bin" entry in the riot Makefile must be:

"bin": {
    "riot": "node_modules/riot/.bin/riot"
  }

or

"bin": {
    "riot": "node_modules/riot/node_modules/riot-cli/lib/index.js"
  }
@jobrodesign

BTW riot is awesome and amazing and I really appreciate all the work you are putting into it.

@GianlucaGuarini GianlucaGuarini added fixed and removed to verify labels Feb 27, 2016
@GianlucaGuarini GianlucaGuarini added a commit that closed this issue Feb 27, 2016
@GianlucaGuarini GianlucaGuarini closes #1605 f1fa0ff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment