JamieMason / shrinkpack

Fast, resilient, reproducible builds with npm install.
https://www.npmjs.com/package/shrinkpack
MIT License
793 stars 38 forks source link

npm 6 support (removed the `npm cache ls`) #94

Closed reggi closed 2 years ago

reggi commented 6 years ago

It seems npm 6 removed the npm cache ls command. :(

➜  abide git:(updates) ✗ npm run shrinkpack

> abide@1.0.0 shrinkpack /Users/thomas/Desktop/github.com/reggi/abide
> shrinkpack

(node:16788) UnhandledPromiseRejectionWarning: Error: Command failed: npm cache ls
npm ERR! Usage: npm cache add <tarball file>
npm ERR! npm cache add <folder>
npm ERR! npm cache add <tarball url>
npm ERR! npm cache add <git url>
npm ERR! npm cache add <name>@<version>
npm ERR! npm cache clean
npm ERR! npm cache verify

    at Promise.all.then.arr (/Users/thomas/Desktop/github.com/reggi/abide/node_modules/shrinkpack/node_modules/execa/index.js:170:11)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:182:7)
(node:16788) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:16788) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
! Please raise an issue at https://github.com/JamieMason/shrinkpack/issues

    Error: ! failed to read contents of npm cache
        at ChildProcess.onClose (/Users/thomas/Desktop/github.com/reggi/abide/node_modules/shrinkpack/src/analyse/read-npm-cache.js:40:25)
        at ChildProcess.emit (events.js:180:13)
        at maybeClose (internal/child_process.js:936:16)
        at Socket.stream.socket.on (internal/child_process.js:353:11)
        at Socket.emit (events.js:180:13)
        at Pipe._handle.close [as _onclose] (net.js:541:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! abide@1.0.0 shrinkpack: `shrinkpack`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the abide@1.0.0 shrinkpack script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/thomas/.npm/_logs/2018-05-24T03_21_57_774Z-debug.log
JamieMason commented 2 years ago

shrinkpack@0.19.0 has been released which adds support for npm 7 and up.