static-dev/spike-core

Running test introduces new dependency strip-json-comments which is not declared

Closed this issue · 6 comments

⚡ description

In a fresh repo, run either yarn install or npm install followed by commit succeeds.

spike-core admin$ yarn install
yarn install v0.27.5
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 8.24s.
spike-core$ git commit -am"dummy commit to test"
husky > npm run -s precommit (node v6.9.1)

[master 4c5fcb1] dummy commit to test
 1 file changed, 1 insertion(+), 1 deletion(-)

But if npm test is run then the commit will fail with the following:

  41 tests passed [14:07:24]
  1 test skipped

spike-core admin$ git commit -am"dummy commit to test"
husky > npm run -s precommit (node v6.9.1)

module.js:471
    throw err;
    ^

Error: Cannot find module 'strip-json-comments'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/admin/spike/spike-core/node_modules/eslint/lib/config/config-file.js:24:21)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
[master ac24f8e] dummy commit to test
 1 file changed, 1 insertion(+), 1 deletion(-)

Not sure why that is but easy solution is just add 'strip-json-comments' as dependency to packages.json

🌎 environment

This sounds like an error with an upstream dependency, strip-json-comments is not used anywhere in spike core or it's tests in the written code. This is strange though, I just tried to replicate it and was unable to...

this is what's using it:
./node_modules/fsevents/node_modules/strip-json-comments

npm list | grep fsevent
│ │ ├─┬ fsevents@1.1.2

Ok, fsevents is compiled for the platform you are on if I'm not mistaken. I haven't seen this issue on either mac or windows. Are you running linux?

OS X EL Capitan 10.11.6 I'm a couple of versions behind. Probably not worth changing anything.

I'm going to close this since it's perhaps more related to ava than spike and only in narrow situations.