Can't get styl to run (its an NPM package) - node.js

I have nodejs, grunt and npm installed, did it months ago was able run things and then I had a project come up so wasn't able to dive into it as much as I wanted, but I know it was all setup correctly. Now months later I need to get "styl"
https://www.npmjs.com/package/styl
working. I installed it like the instructions say to
npm install -g styl
I'm at the directory I want to be and tried to run
styl style.style style.css
and it wont run, it just sits there
I'm on windows 7.

If that css file is written in SASS-style with nesting, you have to pass -w flag to use "significant whitespace pre-processor".
As shown in the example, you have to enable the following command: (with the angle brackets)
$ styl -w < style.style > style.css
Otherwise, it produces empty style.css file.

Related

shadow-cljs watch app error on luminus page

I am using luminus to build a webpage. I want to use clojure script so I created a project with
lein new luminus test +cljs
When starting the webpage I get the following message:
If you're seeing this message, that means you haven't yet compiled your ClojureScript!
Please run shadow-cljs watch app to start the ClojureScript compiler and reload the page.
so I installed and tried to run
npx shadow-cljs watch app
and get the following error:
shadow-cljs - config: /Users/jonas/Dropbox/prog/web/clojure/luminus/test/shadow-cljs.edn
shadow-cljs - running: lein with-profile +dev run -m shadow.cljs.devtools.cli --npm watch app
Executable 'lein' not found on system path.
i've looked everywhere but I cannot solve this problem. Any ideas?
update:
ok, this is what I have done to temporarily solve this:
First install in the test dir:
npm install react react-dom create-react-class
then run lein directly:
lein with-profile +dev run -m shadow.cljs.devtools.cli --npm watch app
so it is not suppose to be like this, but this is the closest that I get.
ok, I looked after a path variable to set but could not find one. So I simply copied lein from ~/bin/lein (my home dir) to /usr/local/bin and now it found it and it works.
Strange that there is no way to set this for shadow

Laravel 5.3 npm gulp not creating output files

I am using Laravel 5.3, node version: 5.7 and npm version: 3.6.
When I run the gulp (or even gulp watch) command I get the same output in terminal as I normally get, everything looks like it should, and it even tells me that it has written to the public/css folder (image below). Navigating to the folder I can see no changes were made to the previous app.css file.
When I delete the file, the css directory remains empty after the gulp commands.
This is my gulpfile.js
const elixir = require('laravel-elixir');
require('laravel-elixir-vue-2');
elixir(mix => {
mix.sass('app.scss')
.webpack('app.js');
});
This is the output I get in the terminal (iTerm on mac OSX):
But lik I said, the public folder remains empty. I can't tell for sure that I updated node or npm or not.. But I don't think I have.
Thanks for the help.
EDIT:
deleting the node-modules folder and running npm install again gives another error.. One I have never seen before:

browsersync not working (note: not using gulp)

I'm trying to use browsersync without Gulp, just plain old html and css, but it won't update any changes made to css. The browsersync shows that it's connected when I open the page through the terminal, but it isn't injecting CSS when I change/add CSS in the project and the terminal just shows this:
[BS] Serving files from: ./
[BS] Watching files...
Okay, so like I said in my previous (deleted) answer, I had the same troubles. Server started, "Connected to BrowserSync" popped up on browser, but no reload when I change anything to my html.
At first, I thought it was Chokidar that was the problem. So I updated it with npm install -g chokidar and npm install chokidar --save. However, when I got home (I had the problem on both my work and home computer), this fix didn't work. Then I noticed this worked: browser-sync start --server --files "*.html", but this failed: browser-sync start --server --files "css/*.css, *.html, js/*.js". That last one is a .bat file I used on my previous project.
So, I started googling and found a different syntax. I changed my command and now it works: browser-sync start --server --files "css/*.css" "*.html" "js/*.js"
(mind the spaces and quotes instead of comma's)
I have no idea if I'm seeing ghosts, or if the syntax actually changed.

jsx command not found on mac terminal

Problem:
I execute the following command from the macintosh terminal:
$ jsx --watch src/ build/
I recieve the following output error from the terminal:
-bash: jsx: command not found
Relevant information:
I am following the following tutorial: https://facebook.github.io/react/docs/getting-started.html
I executed the following command from the tutorial with positive output:
$ npm install -g react-tools
This instruction immediately precedes the instruction that produces the error:
Environment information:
$ node -v
v0.12.4
$ npm
2.10.1
Best of google:
https://groups.google.com/forum/#!topic/reactjs/TUBkgptg2dM
Adtional Notes:
Best of google is short because there aren't many links that provide information that the tutorial provides. A result of this is that I think there is an obvious solution and that I am just being dumb.
I will provide more information if requested
Please excuse the format of this question. This is how I solve a problem. I'm hoping someone can provide the Solution points. I apologize if this is over-the-top for a simple question, but I couldn't find any rules against it.
Solution to my unique problem:
Execute the following command:
$ export PATH=$PATH:$(npm config get prefix)/bin
Original problem command:
$ jsx --watch src/ build/
New positive output:
built Module("helloworld")
["helloworld"]
run this:
npm config get prefix
that will give you a clue as to where your global npm modules are installed. you need to add the bin directory under the directory returned by the above to your path. for example, it might return /usr/local, in which case you should add /usr/local/bin to your PATH. You could just do:
export PATH=$PATH:$(npm config get prefix)/bin

Grunt assemble - strange 'module not found' issue

I'm adapting an existing project to use Grunt, Assemble and other workflow tools. I have the workflow working on one machine, but when I try to run the Gruntfile on a different system I get an error:
[/home/ian/workspace/myproject] (master)
ian#ian-desktop $ grunt assemble
Running "assemble:pages" (assemble) task
Warning: Cannot find module '/home/ian/workspace/myproject/node_modules/
grunt-assemble/node_modules/assemble/node_modules/handlebars-helpers/
lib/helpers/home/ian/workspace/myproject/node_modules/grunt-assemble/
node_modules/assemble/node_modules/handlebars-helpers/lib/helpers/code.js'
Use --force to continue.
Aborted due to warnings.
The path that Grunt is trying to load is completely messed up (note the re-occurrence of the cwd about halfway through), but the filename it's looking for - code.js - is installed locally (by npm -i):
[/home/ian/workspace/myproject] (master)
ian#ian-desktop $ find . -name code.js
./node_modules/grunt-assemble/node_modules/assemble/node_modules/
handlebars-helpers/node_modules/remarkable/lib/rules_block/code.js
./node_modules/grunt-assemble/node_modules/assemble/node_modules/
handlebars-helpers/test/code.js
./node_modules/grunt-assemble/node_modules/assemble/node_modules/
handlebars-helpers/lib/helpers/code.js
./node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/
lib/nodes/code.js
Both the systems I'm working on are Ubuntu 14.10, so shouldn't differ in any material way. Node -v gives v0.10.33, npm -v gives 2.1.5. I've tried:
checking out a fresh copy of the entire project from git
clearing all Bash environment vars before running Grunt
I'm having a hard time figuring out what's at the root of the different behaviour of the same code on two similar machines. Other tasks in my Gruntfile seem to be working fine, it's just the assemble task that's broken. Suggestions of where to look, or debug techniques to try, would be very welcome!

Resources