Nodejs – Error: ENOENT: no such file or directory, scandir ‘node_modules/node-sass/vendor’


I’ve experience weird moment today when trying to run my friend’s gulp script which call node-sass, it throw this error

Error: ENOENT: no such file or directory, scandir '**/node_modules/node-sass/vendor'

I call it weird because normally it has ‘vendor’ folder.

After Googling, visiting some stackoverflow pages, the solution is simple: just invoke these two commands

nodejs node_modules/node-sass/scripts/install.js
npm rebuild node-sass

then you’re good to go 🙂

 

PostgreSQL: Create Database, User and Grant Privileges


Open terminal and invoke this command:

psql -U postgres

to create new database, invoke this command:

CREATE DATABASE mydatabase;

to create new user, invoke this command:

CREATE USER dbuser WITH PASSWORD 'mypassword';

then, you can set your desired user-related preference like this

ALTER ROLE dbuser SET client_encoding TO 'utf8';
ALTER ROLE dbuser SET default_transaction_isolation TO 'read committed';
ALTER ROLE dbuser SET timezone TO 'UTC';

to grant privileges, invoke this command:

GRANT ALL PRIVILEGES ON DATABASE mydatabase TO dbuser;

Quit from PostgreSQL console

\q