Category: node.js

NodeJS v8 0

NodeJS v8 "err": {"message": "fsReadFileAsync(...).then(...).then(...).catch(...).done is not a function",

After upgrading code and libraries, you might run into "err":{"message":"fsReadFileAsync(...).then(...).then(...).catch(...).done is not a function", An example erroneous code const fsReadFileAsync = util.promisify(fs.readFile.bind(fs)); const fsWriteFileAsync = util.promisify(fs.writeFile.bind(fs)); // First apply changes to fstab fsReadFileAsync(this._fstabFilename, "utf8")...

npm not found when under sudo 0

npm not found when under sudo

[dev@squarepants www]$ sudo npm install -g bbb sudo: npm: command not found Solution You have probably like me installed node with nvm (node version manager). This installs node locally for the user and root...

Install a node workstation with nvm 0

Install a node workstation with nvm

1 NVM 1.1 Install nvm Note: Get the latest command from https://github.com/creationix/nvm $> curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.9/install.sh | bash $> export NVM_DIR="$HOME/.nvm" $> [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm 1.2 Verify it...

Node.js reloading modules solution 0

Node.js reloading modules solution

In node.js, if you make change to a module's exported variable, the changes will not propagate to another module that already imported it. So what solution can we do to go around this "caching"...

Resolving 502 Bad Gateway on bbb server 0

Resolving 502 Bad Gateway on bbb server

Well there can be multiple reasons for this error. But in my node.js development with mongoDB, this always occurs when mongoDB could not be started. The solution was always to cleanup old mongod.lock files....