Skip to content
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

Unable to "npm install" or "yarn add" version 2.8.2 #279

Open
segoma opened this issue Dec 14, 2021 · 4 comments
Open

Unable to "npm install" or "yarn add" version 2.8.2 #279

segoma opened this issue Dec 14, 2021 · 4 comments

Comments

@segoma
Copy link

segoma commented Dec 14, 2021

Hi,
We are unable to get the new pc-ble-driver-js on our Debian 11 machines, running node version 12.22.5.
We receive the following error:

npm install pc-ble-driver-js
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see request/request#3142
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm ERR! code 1
npm ERR! path /central/test/node_modules/pc-ble-driver-js
npm ERR! command failed
npm ERR! command sh -c node do_prebuild.js --decompress-only || node do_prebuild.js --install-only || node do_prebuild.js
npm ERR! options.shared_install_dir:/central/test/node_modules/pc-ble-driver-js/Release
npm ERR! options.shared_install_dir:/central/test/node_modules/pc-ble-driver-js/Release
npm ERR! options.shared_install_dir:/central/test/node_modules/pc-ble-driver-js/Release
npm ERR! /central/test/node_modules/pc-ble-driver-js/do_prebuild.js:219
npm ERR! throw new Error("npm_config_runtime needs to be specified");
npm ERR! ^
npm ERR!
npm ERR! Error: npm_config_runtime needs to be specified
npm ERR! at Object. (/central/test/node_modules/pc-ble-driver-js/do_prebuild.js:219:11)
npm ERR! at Module._compile (internal/modules/cjs/loader.js:999:30)
npm ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR! at Module.load (internal/modules/cjs/loader.js:863:32)
npm ERR! at Function.Module._load (internal/modules/cjs/loader.js:708:14)
npm ERR! at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
npm ERR! at internal/main/run_main_module.js:17:47
npm ERR! /central/test/node_modules/pc-ble-driver-js/do_prebuild.js:219
npm ERR! throw new Error("npm_config_runtime needs to be specified");
npm ERR! ^
npm ERR!
npm ERR! Error: npm_config_runtime needs to be specified
npm ERR! at Object. (/central/test/node_modules/pc-ble-driver-js/do_prebuild.js:219:11)
npm ERR! at Module._compile (internal/modules/cjs/loader.js:999:30)
npm ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR! at Module.load (internal/modules/cjs/loader.js:863:32)
npm ERR! at Function.Module._load (internal/modules/cjs/loader.js:708:14)
npm ERR! at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
npm ERR! at internal/main/run_main_module.js:17:47
npm ERR! /central/test/node_modules/pc-ble-driver-js/do_prebuild.js:219
npm ERR! throw new Error("npm_config_runtime needs to be specified");
npm ERR! ^
npm ERR!
npm ERR! Error: npm_config_runtime needs to be specified
npm ERR! at Object. (/central/test/node_modules/pc-ble-driver-js/do_prebuild.js:219:11)
npm ERR! at Module._compile (internal/modules/cjs/loader.js:999:30)
npm ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR! at Module.load (internal/modules/cjs/loader.js:863:32)
npm ERR! at Function.Module._load (internal/modules/cjs/loader.js:708:14)
npm ERR! at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
npm ERR! at internal/main/run_main_module.js:17:47

npm ERR! A complete log of this run can be found in:
npm ERR! /home/segoma/.npm/_logs/2021-12-14T12_33_41_033Z-debug.log

@datenreisender
Copy link
Contributor

As the error message says, I think you need to set the environment variable npm_config_runtime (and also npm_config_target). As an alternative to the environment variables, you can also set the values runtime and target in an .npmrc.

@ShaharHD
Copy link
Contributor

ShaharHD commented Dec 16, 2021

@datenreisender I have the same issue (on OS X where the OP seems to be running on Linux), empty folder without package.json and no electron is being used... (those settings are relevant for electron AFAIK)

If those settings are required (which they aren't needed to any other npm package which build binaries like sqlite) can you please supply an example for the required settings in .npmrc for NodeJS 16.x.x ?

@halstar
Copy link

halstar commented Jan 12, 2022

@segoma & @ShaharHD , I got the very same issue on Windows 10, with Git Bash & Node v16.13.0, a setup on which I could install whatever I want, so far.

But I could move on with the following operations:
=> Install & use Node v14.18.3 (used nvm), the latest version for which Nordic provided a pre-built release, AFAIK,
=> export npm_config_runtime=node (don't know if this actually makes sense, but I didn't want to install Electron),
=> export npm_config_target=14.18.3,
=> npm install pc-ble-driver-js
=> Now, it's all OK!

Note: I tried to rebuild this library within my Node v16.13.0 environment, but in vain: 4 hours lost! :-\

@ShaharHD
Copy link
Contributor

@halstar if that's the case, then you can try to add those settings to the .npmrc file as:

npm_config_runtime=node
npm_config_target=14

I'll test on my setup later and will update this comment as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants