-
-
Notifications
You must be signed in to change notification settings - Fork 40
Conversation
|
||
childProcess.on("close", code => { | ||
if (code) { | ||
reject({ | ||
code, | ||
message: `child process exited with code ${code}`, | ||
}); | ||
} else { | ||
const versionRegex = /^(?:\d+\.){2}\d+.*?$/m; | ||
const matches = stdoutData.toString().match(versionRegex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a dependency to 'semver'. We can use it instead if the regex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea here is to get the version from the string. Output of tns --version
is:
Support for Node.js 9.0.0 is not verified. This CLI might not install or run properly.
3.3.0
So the regex should find the 3.3.0
version from it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make the title follow these https://gist.github.com/stephenparish/9941e89d80e2bc58a153 coding convetions? Something like `fix(ns-bundle): support for NodeJS 9"
8c9b70b
to
3116e5d
Compare
@sis0k0 I've updated the PR title and the commit message |
When you have Node.js 9 installed, CLI prints a warning that support for this version is not verified. Our webpack plugin tries to get the version, but it receives the warning and decides the version is incorrect. So all scripts fail. In order to resolve the issue, get all data send to the stdout of the spawned `tns --version` process and parse it.
3116e5d
to
17d52d2
Compare
When you have Node.js 9 installed, CLI prints a warning that support for this version is not verified. Our webpack plugin tries to get the version, but it receives the warning and decides the version is incorrect. So all scripts fail.
In order to resolve the issue, get all data send to the stdout of the spawned
tns --version
process and parse it.