Cli: [email protected] will not install from npm, Cannot read property 'match' of undefined

Created on 16 Feb 2020  路  14Comments  路  Source: forcedotcom/cli

Summary

sfdx-cli from npm is failing to install at latest version, which is breaking CI/CD pipelines.

The following command will fail from a virgin node latest docker:

shell% npm install sfdx-cli --global

Steps To Reproduce:

  1. docker run -it node:13.8.0-alpine3.10 /bin/ash
  2. npm install sfdx-cli --global
  3. sfdx fails to install

Expected result

  1. docker run -it node:13.8.0-alpine3.10 /bin/ash
  2. npm install sfdx-cli --global
  3. sfdx installs

Actual result

2465 http fetch GET 200 https://registry.npmjs.org/@salesforce/command/-/command-1.5.0.tgz 73ms
2466 silly pacote version manifest for @salesforce/[email protected] fetched in 78ms
2467 timing stage:rollbackFailedOptional Completed in 0ms
2468 timing stage:runTopLevelLifecycles Completed in 45418ms
2469 verbose stack TypeError: Cannot read property 'match' of undefined
2469 verbose stack     at tarballToVersion (/usr/local/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:87:20)
2469 verbose stack     at inflatableChild (/usr/local/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:99:22)
2469 verbose stack     at /usr/local/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:55:12
2469 verbose stack     at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
2469 verbose stack     at Object.gotValue (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/reduce.js:155:18)
2469 verbose stack     at Object.gotAccum (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/reduce.js:144:25)
2469 verbose stack     at Object.tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
2469 verbose stack     at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:517:31)
2469 verbose stack     at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:574:18)
2469 verbose stack     at Promise._settlePromiseCtx (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:611:10)
2469 verbose stack     at _drainQueueStep (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:142:12)
2469 verbose stack     at _drainQueue (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:131:9)
2469 verbose stack     at Async._drainQueues (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:147:5)
2469 verbose stack     at Immediate.Async.drainQueues [as _onImmediate] (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
2469 verbose stack     at processImmediate (internal/timers.js:456:21)

Workarounds

  1. install the previous version of sfdx: npm install [email protected] --global
  2. Use yarn

Additional information

SFDX CLI Version(to find the version of the CLI engine run sfdx --version):

SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)

OS and version:

Most helpful comment

We just pushed 7.46.3 to fix the issue. Give it a go.

All 14 comments

I'm able to reproduce but I'm not sure why yet. Another workaround is to use yarn.

I have exactly the same error on Jenkins (Dockerfile running on linux) and on Windows
Had to downgrade to the previous version so it works again

npm install -g [email protected]

Same here. Pipeline is not working since sunday:

Step 6/13 : RUN npm install sfdx-cli --global
 ---> Running in 3c5123c60c9a
npm WARN deprecated [email protected]: This package has been deprecated in favour of @sinonjs/samsam
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! Cannot read property 'match' of undefined

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-02-17T15_03_51_842Z-debug.log
The command '/bin/sh -c npm install sfdx-cli --global' returned a non-zero code: 1

I'll take a look at this today and post when I have an update.

Same here. Yarn or an older version than 7.46.1 are the current workarounds.

We're also experiencing this.

We were hoping patch 7.46.2 would resolve the issue but it doesn't look like it did. We are having trouble finding the root cause. I will post an update when we have one but this could take a bit longer to find.

Same issue here... :'(
The latest version that is working is 7.45.1...

I tried all the others above that, including the newest 7.46.2 but I found the same issue...

Found the issue: in salesforcedx package there is a dependency on "@salesforce/sfdx-plugin-lwc-test": "0.1.1". This version has a bad npm-shrinkwrap.json, and should be updated t version 0.1.3

thanks @gbutt! i was about to look myself!

We just pushed 7.46.3 to fix the issue. Give it a go.

Hi, is anyone facing this issue
image

npm registry was having problems today. Working for me now.

npm registry was having problems today. Working for me now.

thank you for quick response @keirbowden. Sadly it is still an issue.

Was this page helpful?
0 / 5 - 0 ratings