TypeError: Cannot read property 'tslib' of undefined on npm install

website
priority:medium
help-wanted
cli
triaged

(Philipp Christoph) #1

What I Wanted to Do

Install dependencies in a project using npm install.

What Happened Instead

1541 warn @wdsm/core@0.0.1 requires a peer of mdn-canvas-to-blob@^1.0.0 but none is installed. You must install peer dependencies yourself.
1542 warn @angular/compiler-cli@7.0.4 requires a peer of @angular/compiler@7.0.4 but none is installed. You must install peer dependencies yourself.
1543 warn ngx-translate-messageformat-compiler@4.4.0 requires a peer of messageformat@>=2.0.0 <=2.0.2 || >2.0.4 <3.0.0 but none is installed. You must install peer dependencies yourself.
1544 warn The package angular-oauth2-oidc is included as both a dev and production dependency.
1545 verbose stack TypeError: Cannot read property 'tslib' of undefined
1545 verbose stack     at /Users/t_wdsm/.nvm/versions/node/v10.13.0/lib/node_modules/npm/lib/install/update-package-json.js:27:36
1545 verbose stack     at Array.map (<anonymous>)
1545 verbose stack     at module.exports (/Users/t_wdsm/.nvm/versions/node/v10.13.0/lib/node_modules/npm/lib/install/update-package-json.js:23:8)
1545 verbose stack     at tryCatcher (/Users/t_wdsm/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
1545 verbose stack     at ret (eval at makeNodePromisifiedEval (/Users/t_wdsm/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/bluebird/js/release/promisify.js:184:12), <anonymous>:13:39)
1545 verbose stack     at readJson.then.catch.then.then (/Users/t_wdsm/.nvm/versions/node/v10.13.0/lib/node_modules/npm/lib/install/action/refresh-package-json.js:35:14)
1545 verbose stack     at tryCatcher (/Users/t_wdsm/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
1545 verbose stack     at Promise._settlePromiseFromHandler (/Users/t_wdsm/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
1545 verbose stack     at Promise._settlePromise (/Users/t_wdsm/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
1545 verbose stack     at Promise._settlePromise0 (/Users/t_wdsm/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
1545 verbose stack     at Promise._settlePromises (/Users/t_wdsm/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
1545 verbose stack     at Promise._fulfill (/Users/t_wdsm/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
1545 verbose stack     at Promise._resolveCallback (/Users/t_wdsm/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:454:14)
1545 verbose stack     at Promise._settlePromiseFromHandler (/Users/t_wdsm/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:524:17)
1545 verbose stack     at Promise._settlePromise (/Users/t_wdsm/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
1545 verbose stack     at Promise._settlePromise0 (/Users/t_wdsm/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
1546 verbose cwd /Library/buildAgent/work/32c73a5dc0c35702
1547 verbose Darwin 17.5.0
1548 verbose argv "/Users/t_wdsm/.nvm/versions/node/v10.13.0/bin/node" "/Users/t_wdsm/.nvm/versions/node/v10.13.0/bin/npm" "i" "--verbose"
1549 verbose node v10.13.0
1550 verbose npm  v6.4.1
1551 error Cannot read property 'tslib' of undefined
1552 verbose exit [ 1, true ]

Reproduction Steps

rm -rf node_modules package-lock.json
npm i --verbose

Details

As you can see, I attempted to remove node_modules and package-lock.json before running npm i to no avail.
Before updating to node 10.13.0 (had 10.4.0 previously), the error appeared once and when running npm i for a second time disappeared.

After updating, the error appears constantly.

Platform Info

$ npm --versions
npm info it worked if it ends with ok
npm info using npm@6.4.1
npm info using node@v10.13.0
{ 'wdsm-kunden-app': '0.0.1',
  npm: '6.4.1',
  ares: '1.14.0',
  cldr: '33.1',
  http_parser: '2.8.0',
  icu: '62.1',
  modules: '64',
  napi: '3',
  nghttp2: '1.34.0',
  node: '10.13.0',
  openssl: '1.1.0i',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.23.2',
  v8: '6.8.275.32-node.36',
  zlib: '1.2.11' }
npm timing npm Completed in 162ms
npm info ok

$ node -p process.platform
darwin