Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

GumnutFarmer's avatar

Unable to install tool or resource tool

Hi, I've been trying to install a resource tool, have been going in circles for a couple of days. Could anyone give me some direction here?

 php artisan nova:resource-tool mojo/cart

 Would you like to install the tool's NPM dependencies? (yes/no) [yes]:
 >
------ trimmed -------

> [email protected] postinstall /srv/mojo/nova-components/Cart/node_modules/pngquant-bin
> node lib/install.js

  ⚠ The `/srv/mojo/nova-components/Cart/node_modules/pngquant-bin/vendor/pngquant` binary doesn't seem to work correctly
  ⚠ pngquant pre-build test failed
  ℹ compiling from source
  ✔ pngquant pre-build test passed successfully
  ✖ Error: pngquant failed to build, make sure that libpng-dev is installed
    at /srv/mojo/nova-components/Cart/node_modules/pngquant-bin/node_modules/bin-build/node_modules/execa/index.js:231:11
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Promise.all (index 0)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node lib/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Yes, libpng-dev is installed. I've also done the reinstall of node_modules. Can't seem to find any other solutions. Debian Bullseye, node 14, npm 6

0 likes
3 replies
GumnutFarmer's avatar

So it seems that the troublesome dependency is related to early versions of laravel-mix. I've got around it with the following work-around.

php artisan nova:resource-tool acme/stripe-inspector

 Would you like to install the tool's NPM dependencies? (yes/no) [yes]:
 > no

 Would you like to compile the tool's assets? (yes/no) [yes]:
 > no

 Would you like to update your Composer packages? (yes/no) [yes]:
 > yes

--- snip ---

Then in your tool change package.json to

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "mix",
        "watch": "mix watch",
        "watch-poll": "mix watch -- --watch-options-poll=1000",
        "hot": "mix watch --hot",
        "prod": "npm run production",
        "production": "mix --production"
    },
    "devDependencies": {
        "laravel-mix": "^6.0",
        "resolve-url-loader": "^5.0.0",
        "sass": "^1.49.7",
        "sass-loader": "^12.6.0"
    },
    "dependencies": {
        "vue": "^3.2"
    }
}

and add .vue() to webpack.mix.js in the tool

let mix = require('laravel-mix')

mix
  .setPublicPath('dist')
  .js('resources/js/tool.js', 'js')
  .sass('resources/sass/tool.scss', 'css')
  .vue()

now update the packages from the site root

npm run build-stripe-inspector
composer update
2 likes
Romain's avatar

Hey,

thanks for that post. I'm also having troubles but with nova:field. It seems the package.json created has some very old dependencies and our new NPM doesn't like that very much. I've asked the question on their live chat, waiting for an answer. I'll try your way now.

GumnutFarmer's avatar

Couldn't get it to work in the end, vue components in the tool won't appear. So frustrated I'm looking for a different package.

Please or to participate in this conversation.