Problem
I can't seem to install and packages using npm. It seems to be a DNS query issue. Has anyone found a way to fix this?
Software
node --version v10.18.1
npm --version 6.13.4
OS
Virtualization: qemu
Operating System: Ubuntu 18.04.3 LTS
Kernel: Linux 4.15.0-55-generic
Architecture: x86-64
Logs
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install', 'webpack' ]
2 info using npm#6.13.4
3 info using node#v10.18.1
4 verbose npm-session 854255086166d555
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData error for webpack#^4.17.0 The value "4294967295" is invalid for option "family"
8 timing stage:rollbackFailedOptional Completed in 49ms
9 timing stage:runTopLevelLifecycles Completed in 3593ms
10 verbose stack TypeError [ERR_INVALID_OPT_VALUE]: The value "4294967295" is invalid for option "family"
10 verbose stack at lookup (dns.js:112:11)
10 verbose stack at net.js:1004:5
10 verbose stack at defaultTriggerAsyncIdScope (internal/async_hooks.js:294:19)
10 verbose stack at lookupAndConnect (net.js:1003:3)
10 verbose stack at TLSSocket.Socket.connect (net.js:938:5)
10 verbose stack at Object.connect (_tls_wrap.js:1165:13)
10 verbose stack at HttpsAgent.createConnection (https.js:120:22)
10 verbose stack at HttpsAgent.createSocket (/usr/lib/node_modules/npm/node_modules/agentkeepalive/lib/_http_agent.js:265:26)
10 verbose stack at HttpsAgent.createSocket (/usr/lib/node_modules/npm/node_modules/agentkeepalive/lib/agent.js:77:11)
10 verbose stack at HttpsAgent.addRequest (/usr/lib/node_modules/npm/node_modules/agentkeepalive/lib/_http_agent.js:239:10)
10 verbose stack at new ClientRequest (_http_client.js:249:16)
10 verbose stack at request (https.js:289:10)
10 verbose stack at fetch.Promise (/usr/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:54:17)
10 verbose stack at new Promise (<anonymous>)
10 verbose stack at fetch (/usr/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:41:10)
10 verbose stack at retry (/usr/lib/node_modules/npm/node_modules/make-fetch-happen/index.js:332:14)
11 verbose cwd /var/www/magellan/app
12 verbose Linux 4.15.0-55-generic
13 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "webpack"
14 verbose node v10.18.1
15 verbose npm v6.13.4
16 error code ERR_INVALID_OPT_VALUE
17 error The value "4294967295" is invalid for option "family"
18 verbose exit [ 1, true ]
Maybe this is somehow related to this issue described in the balena forum:
the mentioned exception comes probably from the dns.js in node and may be a result from a "mysterious" variable intialization:
family = options.family >>> 0;
It looks like that an undefined value for family gets evaluated to "4294967295" instead of "0" while using QEMU.
If you have access to the code for the underlying call (at net.js:1004:5), maybe you can do a similiar workaround and add a fixed value for this family-parameter to the "lookup" function call.
Related
when i tried to run npm install -g create-react-app to create react app getting following error.
when i tired to run "npm install -g npm" getting same error.
Could you please guide me solve this issue ?
debug.log file,
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'create-react-app'
1 verbose cli ]
2 info using npm#6.14.13
3 info using node#v14.17.1
4 verbose npm-session 5c7b621106479737
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for create-react-app#latest error:0909006C:PEM routines:get_name:no start line
8 timing stage:rollbackFailedOptional Completed in 1ms
9 timing stage:runTopLevelLifecycles Completed in 162ms
10 verbose stack Error: error:0909006C:PEM routines:get_name:no start line
10 verbose stack at Object.createSecureContext (_tls_common.js:149:17)
10 verbose stack at Object.connect (_tls_wrap.js:1597:48)
10 verbose stack at HttpsAgent.createConnection (https.js:137:22)
10 verbose stack at HttpsAgent.createSocket (C:\Program Files\nodejs\node_modules\npm\node_modules\agentkeepalive\lib\_http_agent.js:265:26)
10 verbose stack at HttpsAgent.createSocket (C:\Program Files\nodejs\node_modules\npm\node_modules\agentkeepalive\lib\agent.js:77:11)
10 verbose stack at HttpsAgent.addRequest (C:\Program Files\nodejs\node_modules\npm\node_modules\agentkeepalive\lib\_http_agent.js:239:10)
10 verbose stack at new ClientRequest (_http_client.js:305:16)
10 verbose stack at request (https.js:333:10)
10 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:54:17
10 verbose stack at new Promise (<anonymous>)
10 verbose stack at fetch (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:41:10)
10 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\make-fetch-happen\index.js:332:14
10 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\promise-retry\index.js:29:24
11 verbose cwd C:\Users\user\development
12 verbose Windows_NT 10.0.19042
13 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "create-react-app"
14 verbose node v14.17.1
15 verbose npm v6.14.13
16 error code ERR_OSSL_PEM_NO_START_LINE
17 error error:0909006C:PEM routines:get_name:no start line
18 verbose exit [ 1, true ]```
Use the below commands to set up the development environment.
npx create-react-app my-app
cd my-app
npm start
Always follow the Documentation :)
I am currently trying to learn react and I cannot add bootstrap as a dependency in my package.json using npm. I am trying the command npm install bootstrap in my terminal and I am in my current project directory. Here is the error:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/home/lan/.nvm/versions/node/v14.17.0/bin/node',
1 verbose cli '/home/lan/.nvm/versions/node/v14.17.0/bin/npm',
1 verbose cli 'install',
1 verbose cli 'bootstrap',
1 verbose cli '--save'
1 verbose cli ]
2 info using npm#6.14.13
3 info using node#v14.17.0
4 verbose npm-session 2a73fc2953f50908
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 304 https://registry.npmjs.org/bootstrap 470ms (from cache)
8 silly fetchPackageMetaData error for bootstrap#^5.0.1 Unexpected end of JSON input while parsing near '..."shx":"^0.1.2","time-'
9 timing stage:rollbackFailedOptional Completed in 2ms
10 timing stage:runTopLevelLifecycles Completed in 596ms
11 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '..."shx":"^0.1.2","time-'
11 verbose stack at JSON.parse (<anonymous>)
11 verbose stack at parseJson (/home/lan/.nvm/versions/node/v14.17.0/lib/node_modules/npm/node_modules/json-parse-better-errors/index.js:7:17)
11 verbose stack at /home/lan/.nvm/versions/node/v14.17.0/lib/node_modules/npm/node_modules/node-fetch-npm/src/body.js:96:50
11 verbose stack at processTicksAndRejections (internal/process/task_queues.js:95:5)
12 verbose cwd /media/lan/3561-3761/WebProjects/LearnReact
13 verbose Linux 5.8.0-53-generic
14 verbose argv "/home/lan/.nvm/versions/node/v14.17.0/bin/node" "/home/lan/.nvm/versions/node/v14.17.0/bin/npm" "install" "bootstrap" "--save"
15 verbose node v14.17.0
16 verbose npm v6.14.13
17 error Unexpected end of JSON input while parsing near '..."shx":"^0.1.2","time-'
18 verbose exit [ 1, true ]
I am currently in a Ubuntu 20.04.2 LTS OS.
I am working through Digital Asset Getting Started with Node.js bindings.
Running
npm install #da/daml-ledger
causes the following error message
npm ERR! code E401
npm ERR! 401 Unauthorized: #da/daml-ledger#latest
npm ERR! A complete log of this run can be found in:
npm ERR! /...../.npm/_logs/2019-02-22T17_48_44_560Z-debug.log
here are the contents of that log file:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/lib/nodejs/node-v10.15.1-linux-x64/bin/node',
1 verbose cli '/usr/local/lib/nodejs/node-v10.15.1-linux-x64/bin/npm',
1 verbose cli 'install',
1 verbose cli '#da/daml-ledger' ]
2 info using npm#6.4.1
3 info using node#v10.15.1
4 verbose npm-session 99e5e60df68735cb
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 401 https://api.bintray.com/npm/digitalassetsdk/npm/#da%2fdaml-ledger 411ms
8 silly fetchPackageMetaData error for #da/daml-ledger#latest 401 Unauthorized: #da/daml-ledger#latest
9 timing stage:rollbackFailedOptional Completed in 4ms
10 timing stage:runTopLevelLifecycles Completed in 515ms
11 verbose stack Error: 401 Unauthorized: #da/daml-ledger#latest
11 verbose stack at fetch.then.res (/usr/local/lib/nodejs/node-v10.15.1-linux-x64/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/fetch.j
s:42:19)
11 verbose stack at tryCatcher (/usr/local/lib/nodejs/node-v10.15.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
11 verbose stack at Promise._settlePromiseFromHandler (/usr/local/lib/nodejs/node-v10.15.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/relea
se/promise.js:512:31)
11 verbose stack at Promise._settlePromise (/usr/local/lib/nodejs/node-v10.15.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise.
js:569:18)
11 verbose stack at Promise._settlePromise0 (/usr/local/lib/nodejs/node-v10.15.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise
.js:614:10)
11 verbose stack at Promise._settlePromises (/usr/local/lib/nodejs/node-v10.15.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise
.js:693:18)
11 verbose stack at Async._drainQueue (/usr/local/lib/nodejs/node-v10.15.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:
16)
11 verbose stack at Async._drainQueues (/usr/local/lib/nodejs/node-v10.15.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143
:10)
11 verbose stack at Immediate.Async.drainQueues [as _onImmediate] (/usr/local/lib/nodejs/node-v10.15.1-linux-x64/lib/node_modules/npm/node_modules/blueb
ird/js/release/async.js:17:14)
11 verbose stack at runCallback (timers.js:705:18)
11 verbose stack at tryOnImmediate (timers.js:676:5)
11 verbose stack at processImmediate (timers.js:658:5)
12 verbose cwd /home/vantage/DAnodeBindings
13 verbose Linux 4.15.0-45-generic
14 verbose argv "/usr/local/lib/nodejs/node-v10.15.1-linux-x64/bin/node" "/usr/local/lib/nodejs/node-v10.15.1-linux-x64/bin/npm" "install" "#da/daml-ledger"
15 verbose node v10.15.1
16 verbose npm v6.4.1
17 error code E401
18 error 401 Unauthorized: #da/daml-ledger#latest
19 verbose exit [ 1, true ]
I followed the instructions in step 1 and step 2. my .npmrc is updated with the response I received from entering
curl -umehul#digitalassetsdk:<API_KEY> https://api.bintray.com/npm/digitalassetsdk/npm/auth/scope/da
and I entered the command
npm config set #da:registry https://api.bintray.com/npm/digitalassetsdk/npm
What is causing the error?
From the comments it appears you missed a step of the setup, namely as the instructions tell you to paste the response of curl to ~/.npmrc.
The response should be pasted in the ~/.npmrc (in Windows %USERPROFILE%/.npmrc) file.
As an alternative, on Linux and MacOS you can just pipe the output of curl to ~/.npmrc as follows:
curl -u<USERNAME>:<API_KEY> https://api.bintray.com/npm/digitalassetsdk/npm/auth/scope/da >> ~/.npmrc
Using the >> operator will preserve the current content of ~/.npmrc and append the output of curl to the file (or create it if it's not there yet). If you want to overwrite the current ~/.npmrc file, just use the > operator instead.
The Bintary 'Set Me Up' Instructions (referenced in step 1.3 of https://docs.daml.com/app-dev/bindings-js/getting-started.html) say to run a curl command and the to run
npm config set #<SCOPE>:registry https://api.bintray.com/npm/digitalassetsdk/npm
When I skip the npm config step I have no problems.
Tried nodeJS 8.12 and 10.11
Running latest npm 6.4.1
When trying to install any package i.e. (npm install -g firebase-tools) I get npm ERR! Only absolute URLs are supported.
Uninstalled and reinstall nodeJS. Still broken. Any help appreciated.
Debug Log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'firebase-tools' ]
2 info using npm#6.4.1
3 info using node#v10.11.0
4 verbose npm-session 442f99e3eed77ef2
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for firebase-tools#latest Only absolute URLs are supported
8 timing stage:rollbackFailedOptional Completed in 0ms
9 timing stage:runTopLevelLifecycles Completed in 206ms
10 verbose stack TypeError: Only absolute URLs are supported
10 verbose stack at getNodeRequestOptions (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\request.js:131:11)
10 verbose stack at fetch.Promise (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:44:21)
10 verbose stack at new Promise (<anonymous>)
10 verbose stack at fetch (C:\Program
Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:41:10)
10 verbose stack at retry (C:\Program Files\nodejs\node_modules\npm\node_modules\make-fetch-happen\index.js:332:14)
10 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\promise-retry\index.js:29:24
11 verbose cwd C:\Users\Mine
12 verbose Windows_NT 10.0.17134
13 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "firebase-tools"
14 verbose node v10.11.0
15 verbose npm v6.4.1
16 error Only absolute URLs are supported
17 verbose exit [ 1, true ]
Solution moved from #StevePerry's question post.
Had to edit .npmrc file located at C:\Users\yourName\.npmrc
It had a bunch of lines. Only ones needed for me:
//registry.npmjs.org/:_authToken="your_auth_token"
scope="your_name"
#"your_name":registry=https://registry.npmjs.org/
I seem to be struggling with getting npm to install web3
Command used:
npm install web3
Error:
npm ERR! Path must be a string. Received undefined
Logs:
info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install', 'web3' ]
2 info using npm#5.0.4
3 info using node#v8.1.3
4 verbose npm-session 02c74f27df35fda1
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 304 https://registry.npmjs.org/web3 236ms (from cache)
8 silly pacote tag manifest for web3#latest fetched in 269ms
9 verbose stack TypeError: Path must be a string. Received undefined
9 verbose stack at assertPath (path.js:28:11)
9 verbose stack at Object.relative (path.js:1248:5)
9 verbose stack at computeVersionSpec (/usr/lib/node_modules/npm/lib/install/deps.js:282:27)
9 verbose stack at Installer.normalizeCurrentTree (/usr/lib/node_modules/npm/lib/install.js:370:69)
9 verbose stack at Array.<anonymous> (/usr/lib/node_modules/npm/node_modules/slide/lib/bind-actor.js:15:8)
9 verbose stack at LOOP (/usr/lib/node_modules/npm/node_modules/slide/lib/chain.js:15:14)
9 verbose stack at /usr/lib/node_modules/npm/node_modules/slide/lib/chain.js:18:7
9 verbose stack at iferr (/usr/lib/node_modules/npm/lib/install.js:328:5)
9 verbose stack at /usr/lib/node_modules/npm/node_modules/iferr/index.js:13:50
9 verbose stack at cb (/usr/lib/node_modules/npm/node_modules/slide/lib/async-map.js:47:24)
9 verbose stack at /usr/lib/node_modules/npm/node_modules/call-limit/call-limit.js:22:12
9 verbose stack at _combinedTickCallback (internal/process/next_tick.js:95:7)
9 verbose stack at process._tickCallback (internal/process/next_tick.js:161:9)
10 verbose cwd /home/username
11 verbose Linux 4.11.7-1-ARCH
12 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "web3"
13 verbose node v8.1.3
14 verbose npm v5.0.4
15 error Path must be a string. Received undefined
16 verbose exit [ 1, true ]
I've tried running them with root user as well.
The problem might come from using a beta version of web3 it's not stable at the moment and currently is under heavy development you have one of two options,
either use a stable version 0.19 I think or something like that.
Another thing I would suggest trying is npm --save in order to save the package locally in the project