rails / cssbundling-rails

Bundle and process CSS in Rails with Tailwind, PostCSS, and Sass via Node.js.
MIT License
579 stars 83 forks source link

rails new AppName --css {sass,bootstrap} --js esbuild fails on npm set-script #26

Closed zedalaye closed 3 years ago

zedalaye commented 3 years ago

When I run : rails new MyApp --js esbuild --css boostrap --database postgresql (same with sass instead of bootstrap)

It fails at this step :

Appending Bootstrap JavaScript import to default entry point

      append  app/javascript/application.js

Add build:css script

         run  npm set-script build:css "sass ./app/assets/stylesheets/application.bootstrap.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules" from "."

Usage: npm <command>

where <command> is one of:
    access, adduser, audit, bin, bugs, c, cache, ci, cit,
    clean-install, clean-install-test, completion, config,
    create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
    edit, explore, fund, get, help, help-search, hook, i, init,
    install, install-ci-test, install-test, it, link, list, ln,
    login, logout, ls, org, outdated, owner, pack, ping, prefix,
    profile, prune, publish, rb, rebuild, repo, restart, root,
    run, run-script, s, se, search, set, shrinkwrap, star,
    stars, start, stop, t, team, test, token, tst, un,
    uninstall, unpublish, unstar, up, update, v, version, view,
    whoami

npm <command> -h  quick help on <command>

npm -l            display full usage info
npm help <term>   search for help on <term>
npm help npm      involved overview

Specify configs in the ini-formatted file:
    /home/pierre/.npmrc

or on the command line via: npm <command> --key value

Config info can be viewed via: npm help config
npm@6.14.15 /usr/lib/node_modules/npm

Did you mean this?
    run-script

Do i miss an npm dependency, is my node/npm too old ?

zedalaye commented 3 years ago

Got it. I need npm v7+ (npm install -g npm@latest)

dhh commented 3 years ago

Open to a version check that tells the user to add this themselves.