dominictarr / JSONStream

rawStream.pipe(JSONStream.parse()).pipe(streamOfObjects)
Other
1.91k stars 165 forks source link

npm installl JSONStream failed on windows #134

Closed zhaoyi0113 closed 7 years ago

zhaoyi0113 commented 7 years ago

I am using JSONStream on windows10 platform but npm install failed as below:

node_modules\JSONStream\index.js Unexpected character '#' (1:0)

The version I am using is "mongodb-extended-json": "^1.9.0",

dominictarr commented 7 years ago

I don't have windows so it's hard for me to debug this, if you clone this repo do the tests pass?

zhaoyi0113 commented 7 years ago

nom test doesn't work because windows don't have shell command such as sed

dominictarr commented 7 years ago

oh sorry - you can also just run each js file in tests/ directly with node. or do npm install tap -g then tap test

zhaoyi0113 commented 7 years ago

I have tried some test cases failed. The output looks like below:

Error: Cannot find module '../'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\devel\tmp\JSONStream\test\disabled\doubledot1.js:4:18)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
test/two-ways.js ...................................... 0/1
  Skipped: 1
    test/two-ways.js no tests found

module.js:472
    throw err;
    ^

Error: Cannot find module '../'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\devel\tmp\JSONStream\test\disabled\doubledot2.js:4:19)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
test/disabled/doubledot1.js ........................... 0/1
  not ok test/disabled/doubledot1.js
    timeout: 30000
    file: test/disabled/doubledot1.js
    command: 'C:\Program Files\nodejs\node.exe'
    args:
      - test/disabled/doubledot1.js
    cwd: 'C:\Users\devel\tmp\JSONStream'
    exitCode: 1

test/disabled/doubledot2.js ........................... 0/1
  not ok test/disabled/doubledot2.js
    timeout: 30000
    file: test/disabled/doubledot2.js
    command: 'C:\Program Files\nodejs\node.exe'
    args:
      - test/disabled/doubledot2.js
    cwd: 'C:\Users\devel\tmp\JSONStream'
    exitCode: 1

total ............................................... 16/33

  16 passing (7s)
  15 pending
  2 failing
dominictarr commented 7 years ago

ah right, those tests are disabled (as you see in url) but tap runs them anyway. so that is actually a successful run.

zhaoyi0113 commented 7 years ago

Does the 2 failing mean successful run?

dominictarr commented 7 years ago

yeah, because those should actually be ignored. if you ran them the other way those wouldn't actually be executed at all.

dominictarr commented 7 years ago

This shows that it runs... but maybe it's something weird that "mongodb-extended-json" does?

zhaoyi0113 commented 7 years ago

cool, thanks for checking it. I will investigate other parts of my app.