node-calls-python package installation on Mac M1 - node.js

Has anyone been able to successfully install node-calls-python package on their Mac M1. When I try to npm install I get the following error:
31 verbose stack Error: Invalid tag name "g++": Tags may not have any characters that encodeURIComponent encodes.
31 verbose stack at invalidTagName (/Users/<here>/.nvm/versions/node/v16.13.2/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:89:15)
31 verbose stack at fromRegistry (/Users/<here>/.nvm/versions/node/v16.13.2/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:343:13)
31 verbose stack at resolve (/Users/<here>/.nvm/versions/node/v16.13.2/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:80:12)
31 verbose stack at npa (/Users/<here>/.nvm/versions/node/v16.13.2/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:48:10)
31 verbose stack at /Users/<here>/.nvm/versions/node/v16.13.2/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:503:50
31 verbose stack at Array.map (<anonymous>)
31 verbose stack at Arborist.[add] (/Users/<here>/.nvm/versions/node/v16.13.2/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:500:28)
31 verbose stack at Arborist.[applyUserRequestsToNode] (/Users/<here>/.nvm/versions/node/v16.13.2/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:471:23)
31 verbose stack at Arborist.[applyUserRequests] (/Users/<here>/.nvm/versions/node/v16.13.2/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:408:43)
31 verbose stack at Arborist.buildIdealTree (/Users/<here>/.nvm/versions/node/v16.13.2/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:215:37)
32 verbose cwd /Users/<here>/Documents/workspace/RnD/nodePythonApp
33 verbose Darwin 21.6.0
34 verbose argv "/Users/<here>/.nvm/versions/node/v16.13.2/bin/node" "/Users/<here>/.nvm/versions/node/v16.13.2/bin/npm" "install" "g++"
35 verbose node v16.13.2
36 verbose npm v8.1.2
37 error code EINVALIDTAGNAME
38 error Invalid tag name "g++": Tags may not have any characters that encodeURIComponent encodes.
I've tried the recommend installation provided on the npm package page and did not work.
https://www.npmjs.com/package/node-calls-python
Any help would be appreciated.

Related

Can I resolve an npm install error without deleting my package-lock.json file?

I'm building a project in create-react-app, and tried to install react-router-dom. The installation however failed and I got the following error:
npm ERR! Cannot read property 'match' of undefined
Similar questions have been asked and the most common solution posted has to been to delete the package-lock.json file, but this seems dangerous to me - does anyone have any other solutions? Also why am I even getting this error in the first place?
Here's the more detailed logs from the error:
0 info it worked if it ends with ok
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 'i',
1 verbose cli 'react-router-dom'
1 verbose cli ]
2 info using npm#6.13.4
3 info using node#v12.16.0
4 verbose npm-session 651e4109d0b3c099
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 304 https://registry.npmjs.org/react-router-dom 1405ms (from cache)
8 silly pacote tag manifest for react-router-dom#latest fetched in 1742ms
9 timing stage:loadCurrentTree Completed in 64390ms
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 timing stage:loadIdealTree:cloneCurrentTree Completed in 67ms
13 silly install loadShrinkwrap
14 timing stage:rollbackFailedOptional Completed in 0ms
15 timing stage:runTopLevelLifecycles Completed in 65031ms
16 silly saveTree gig-fort#0.1.0
17 verbose stack TypeError: Cannot read property 'match' of undefined
17 verbose stack at tarballToVersion (C:\Program Files\nodejs\node_modules\npm\lib\install\inflate-shrinkwrap.js:87:20)
17 verbose stack at inflatableChild (C:\Program Files\nodejs\node_modules\npm\lib\install\inflate-shrinkwrap.js:99:22)
17 verbose stack at C:\Program Files\nodejs\node_modules\npm\lib\install\inflate-shrinkwrap.js:55:12
17 verbose stack at tryCatcher (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
17 verbose stack at Object.gotValue (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\reduce.js:155:18)
17 verbose stack at Object.gotAccum (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\reduce.js:144:25)
17 verbose stack at Object.tryCatcher (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
17 verbose stack at Promise._settlePromiseFromHandler (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:517:31)
17 verbose stack at Promise._settlePromise (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:574:18)
17 verbose stack at Promise._settlePromiseCtx (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:611:10)
17 verbose stack at _drainQueueStep (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:142:12)
17 verbose stack at _drainQueue (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:131:9)
17 verbose stack at Async._drainQueues (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:147:5)
17 verbose stack at Immediate.Async.drainQueues [as _onImmediate] (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
17 verbose stack at processImmediate (internal/timers.js:456:21)
18 verbose cwd C:\Users\Josh\Desktop\gig-fort\gig-fort
19 verbose Windows_NT 10.0.18362
20 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" "react-router-dom"
21 verbose node v12.16.0
22 verbose npm v6.13.4
23 error Cannot read property 'match' of undefined
24 verbose exit [ 1, true ]
the match parameter in react-router-dom is a get parameter in the URL.
So, if you have a url:
http://www.example.com/route?id=foo
then match.params.id is "foo".
You pass in the match parameter into your functional react component to access it.
e.g.
import React from 'react'
const MyComponent = ({match}) => {
return(<div>
The id is: {match.params.id}
</div>)
}
export default MyComponent
The documentation: https://reactrouter.com/web/api/match

NPM Error The value "4294967295" is invalid for option "family"

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.

404 error when trying to pull from Artifactory 5.4.6 NPM repo with NPM or higher if anonymous access is disabled

I have an Artifactory NPM repo named product_release_npm, with anonymous access disabled.
At the project level, I have an .npmrc file with the following content :
#luciad:registry=https://[DOMAIN]/artifactory/api/npm/product_release_npm/
At the user level, I have an .npmrc file with the following content :
//[DOMAIN]/artifactory/api/npm/product_thirdparty_npm/:_authToken=[AUTH_TOKEN]
//[DOMAIN]/artifactory/api/npm/product_release_npm/:_authToken=[AUTH_TOKEN]
My project's package.json file looks like this :
{
"dependencies": {
"#luciad/ria-core": "^2019.0"
}
}
If I do an npm install with NPM 4.2.0 or lower, I'm able to install this repo succesfully.
If I try the same thing with NPM 5.0.0 or higher, I'm unable to install this repo and get a 404 error.
In some versions of NPM, I'm also getting a 403 error.
Here's the log when try this with NPM 5.6.0, on a Linux machine :
0 info it worked if it ends with ok
1 verbose cli [ '/home/release/nodejs/node-v8.11.1-linux-x64/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install' ]
2 info using npm#5.6.0
3 info using node#v8.11.1
4 verbose npm-session 63d1960eac6e1e9a
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall release
7 info lifecycle #~preinstall: #
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 silly install loadShrinkwrap
13 silly install loadAllDepsIntoIdealTree
14 http fetch GET 200 https://[DOMAIN]/artifactory/api/npm/product_release_npm/#luciad%2fria-core 334ms
15 http fetch GET 404 https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz 32ms
16 silly fetchPackageMetaData error for #luciad/ria-core#^2019.0 404 Not Found: #luciad/ria-core#^2019.0
17 http fetch GET 404 https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz 9ms
18 silly fetchPackageMetaData error for #luciad/ria-core#^2019.0 404 Not Found: #luciad/ria-core#^2019.0
19 silly saveTree release
20 verbose stack Error: 404 Not Found: #luciad/ria-core#^2019.0
20 verbose stack at fetch.then.res (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/fetch.js:42:19)
20 verbose stack at tryCatcher (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
20 verbose stack at Promise._settlePromiseFromHandler (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
20 verbose stack at Promise._settlePromise (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
20 verbose stack at Promise._settlePromise0 (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
20 verbose stack at Promise._settlePromises (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
20 verbose stack at Async._drainQueue (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)
20 verbose stack at Async._drainQueues (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
20 verbose stack at Immediate.Async.drainQueues (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
20 verbose stack at runCallback (timers.js:794:20)
20 verbose stack at tryOnImmediate (timers.js:752:5)
20 verbose stack at processImmediate [as _immediateCallback] (timers.js:729:5)
21 verbose cwd /home/release/Desktop/artifactory/release
22 verbose Linux 4.15.0-65-generic
23 verbose argv "/home/release/nodejs/node-v8.11.1-linux-x64/bin/node" "/usr/local/bin/npm" "install"
24 verbose node v8.11.1
25 verbose npm v5.6.0
26 error code E404
27 error 404 Not Found: #luciad/ria-core#^2019.0
28 verbose exit [ 1, true ]
Here's the log when try this with NPM 6.9.0, on a Windows machine :
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' ]
2 info using npm#6.9.0
3 info using node#v10.16.3
4 verbose npm-session e99caa5e8a2881d2
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall release
7 info lifecycle #~preinstall: #
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 timing stage:loadCurrentTree Completed in 13ms
11 silly install loadIdealTree
12 silly install cloneCurrentTreeToIdealTree
13 timing stage:loadIdealTree:cloneCurrentTree Completed in 1ms
14 silly install loadShrinkwrap
15 timing stage:loadIdealTree:loadShrinkwrap Completed in 2ms
16 silly install loadAllDepsIntoIdealTree
17 http fetch GET 304 https://[DOMAIN]/artifactory/api/npm/product_release_npm/#luciad%2fria-core 143ms
18 http fetch GET 404 https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz 12ms
19 silly fetchPackageMetaData error for #luciad/ria-core#^2019.0 404 Not Found - GET https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz
20 http fetch GET 404 https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz 10ms
21 silly fetchPackageMetaData error for #luciad/ria-core#^2019.0 404 Not Found - GET https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz
22 timing stage:rollbackFailedOptional Completed in 0ms
23 timing stage:runTopLevelLifecycles Completed in 248ms
24 silly saveTree release
25 verbose stack Error: 404 Not Found - GET https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz
25 verbose stack at res.buffer.catch.then.body (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-fetch\check-response.js:104:15)
25 verbose stack at process._tickCallback (internal/process/next_tick.js:68:7)
26 verbose statusCode 404
27 verbose pkgid #luciad/ria-core#^2019.0
28 verbose cwd D:\Desktop\EXPERIMENT\artifactory\release
29 verbose Windows_NT 10.0.16299
30 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
31 verbose node v10.16.3
32 verbose npm v6.9.0
33 error code E404
34 error 404 Not Found - GET https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz
35 error 404
36 error 404 '#luciad/ria-core#^2019.0' is not in the npm registry.
37 error 404 You should bug the author to publish it (or use the name yourself!)
38 error 404 Note that you can also install from a
39 error 404 tarball, folder, http url, or git url.
40 verbose exit [ 1, true ]
Any idea what might be causing this and/or how to fix this issue?

E404 when trying to link local npm module

I am getting a 404 error when trying to link a local module with npm following the docs
Inside the local module directory seems like it creates a global link correctly:
$ npm link
/usr/local/lib/node_modules/my-module-name -> /Users/XXX/my-module-directory/my-module-name
But when just after that I try to link this from other project directory i get an 404 error:
$ npm link my-module-name
npm ERR! code E404
npm ERR! 404 Not Found: my-module-name#latest
I've tried to unlink the module and link again or change versions but it doesn't work.
Here is full log:
0 info it worked if it ends with ok
1 verbose cli [ '/Users/XXX/.nvm/versions/node/v8.2.1/bin/node',
1 verbose cli '/Users/XXX/.nvm/versions/node/v8.2.1/bin/npm',
1 verbose cli 'link',
1 verbose cli 'my-module-name' ]
2 info using npm#5.3.0
3 info using node#v8.2.1
4 verbose npm-session 7d82e8d8dc1bdc83
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 404 https://registry.npmjs.org/my-module-name 2304ms
8 silly fetchPackageMetaData error for my-module-name#latest 404 Not Found: my-module-name#latest
9 verbose stack Error: 404 Not Found: my-module-name#latest
9 verbose stack at fetch.then.res (/Users/XXX/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/fetch.js:41:19)
9 verbose stack at tryCatcher (/Users/XXX/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
9 verbose stack at Promise._settlePromiseFromHandler (/Users/XXX/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
9 verbose stack at Promise._settlePromise (/Users/XXX/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
9 verbose stack at Promise._settlePromise0 (/Users/XXX/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
9 verbose stack at Promise._settlePromises (/Users/XXX/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
9 verbose stack at Async._drainQueue (/Users/XXX/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)
9 verbose stack at Async._drainQueues (/Users/XXX/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
9 verbose stack at Immediate.Async.drainQueues (/Users/XXX/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
9 verbose stack at runCallback (timers.js:781:20)
9 verbose stack at tryOnImmediate (timers.js:743:5)
9 verbose stack at processImmediate [as _immediateCallback] (timers.js:714:5)
10 verbose cwd /Users/XXX/my-project-directory
11 verbose Darwin 16.6.0
12 verbose argv "/Users/XXX/.nvm/versions/node/v8.2.1/bin/node" "/Users/XXX/.nvm/versions/node/v8.2.1/bin/npm" "link" "my-module-name"
13 verbose node v8.2.1
14 verbose npm v5.3.0
15 error code E404
16 error 404 Not Found: my-module-name#latest
17 verbose exit [ 1, true ]
You're using an NVM-installed version of Node.js to run npm link my-module-name, but you didn't run npm link (in your module's directory) using that same version.
The initial link is created in /usr/local/lib/node_modules, but when you use NVM, each Node.js version gets their own "lib" directory, in your example /Users/XXX/.nvm/versions/node/v8.2.1/lib/node_modules, which is a different directory.

web3 npm install fails

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

Resources