Dependencies and building
See original GitHub issueHello, I’m having some trouble running tests which I want to do before any PR. Basically, npm won’t work for me (arch linux, node 10.1.0 - npm 6.0.0). I tried switching with nvm to node LTS and even to the same ones used in travis (which builds and test find): node --version v6.14.2 - npm --version 3.10.10 but didn’t work .
The only way I found to build and run tests is with yarn: “yarn install && yarn run build && yarn test”. But a heads up, - if you remove yarn.lock and regenerate it will start failing just npm :
rm -rf yarn.lock package-lock.json node_modules; yarn; yarn install && yarn run build && yarn test
ERRORS:
With node ÑTS and latest, when you use npm or yarn (after yarn.lock is re-generated), the error is :
/home/sg/git/ts-simple-ast/node_modules/typescript/lib/typescript.js:2697
result = f(result, array[pos], pos);
^
TypeError: f is not a function
at /home/sg/git/ts-simple-ast/node_modules/typescript/lib/typescript.js:3025:86
at reduceLeft (/home/sg/git/ts-simple-ast/node_modules/typescript/lib/typescript.js:2697:30)
With node 6.14.2 (same as in travis) the error is:
yarn test
yarn run v1.6.0
$ cross-env TS_NODE_COMPILER="ttypescript" nyc --reporter=lcov mocha --opts mocha.opts
/home/sg/git/ts-simple-ast2/ts-simple-ast/node_modules/ttypescript/lib/patchCreateProgram.js:33
compilerOptions = { ...config.options, ...compilerOptions };
^^^
SyntaxError: Unexpected token ...
at createScript (vm.js:56:10)
at runInThisContext (vm.js:97:10)
at Object.vm.runInThisContext (/home/sg/git/ts-simple-ast2/ts-simple-ast/node_modules/nyc/node_modules/istanbul-lib-hook/lib/hook.js:142:16)
I’m really not understanding how this works in travis - and with node 6.x . Tried to execute tests without instrumentation but got same errors. I would like to investigate this issue further but first wanted to know if there’s any trick I’m not aware ? Right know installing a VM exactly the same as travis to test there…
Any tip is most welcome! thanks
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
Yeah, it only affects the CI and the tests are passing on there so should be ok. It won’t affect anyone using the package. I’ll hopefully be able to revert it back within a few days.
For sure! Any questions you may have about using the library, please feel free to open an issue and I will get around to them. I’m fine with people opening issues to ask questions because then it’s searchable and might help other people.
For questions about the actual code within the library… perhaps I should set up something. For the time being, if you have those kind of questions then feel free to just ask them within this issue if you’d like.
Everything OK now, removing package-lock.json, node_modules and just exec npm i && npm test with node 10 and npm 6. Thanks .
Upgrading node version in .travis.yml shouldn’t hurt right ? (I do understand @types/node we cannot yet) Thanks! (I have /might have a couple of punctual questions do you think it’s OK to ask here in issues ?) do we have other channels besides this ? - the last I want to do is take your time… maybe google groups ? or a wiki page so you can take a look only when convenient ?) thanks gain