-
Notifications
You must be signed in to change notification settings - Fork 468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm test is failed on earlier Node.js versions #409
Comments
Hi @nadongguri, |
Hi @NickNaso, I'm afraid this situation only happens in my environments (I have checked it on ubuntu laptops and servers) but the point is that process.env.npm_config_NAPI_VERSION is "undefined".
As far as I understand, the bigint primitive type is added since Nodejs v10.4.0 so "npm test" is failed with earlier version on Nodejs.
In addition, the version_management test is failed with Nodejs v8.4.0 because of napi in process.versions is Nan. I think this issue also can be solved if this code is working properly.
|
Are you using nvm? |
Hi @NickNaso, |
Hi @NickNaso,
As you see system's verison is v8.12.0. With the latest clean node-addon-api code in master branch,
I'm wondering when process.env.npm_config_NAPI_VERSION is set... or I can add code to check nodejs and napi version then skip those test cases with unproper nodejs. |
I knew how process.env_npm_config_#macro# is set by referring to #350. |
Out CI sets the NAPI_VERSION as follows echo 'console.log(process.versions.napi)' >get_napi_version.js
NAPI_VERSION_REPORTED=`node get_napi_version.js`
npm test --NAPI_VERSION=$NAPI_VERSION_REPORTED We should probably document this somewhere. I think I had tried to make it automatically default to the right value but was not successful. |
I recently added some additional detail in this section: https://github.com/nodejs/node-addon-api#tests. Closing. Please let us know if that was not the right thing to do. |
Hi, node-addon-api,
I've checked 'npm test' with earlier Node.js versions (v8.9.4) on linux env and
some tests such as bigint, callbackscope are required to higher version of Node.js.
Checking napi version is already in test/index.js but the value process.env.npm_config_NAPI_VERSION
is undefined on my setup, so.. users should set that value? (I have searched npm_config_NAPI_VERSION in the node and node-addon-api source but I couldn't find the define).
Or is it fine to modify that code in test/index.js by using a node version to pass tests?
The text was updated successfully, but these errors were encountered: