Node – was compiled against a different Node.js version using NODE_MODULE_VERSION 51

I am running a node application on terminal. Have recently upgraded to node v8.5.0, but am getting this error: Error: The module ‘/tidee/tidee-au/packages/tidee-au-server/node_modules/bcrypt/lib/binding/bcrypt_lib.node’ was compiled against a different Node.js version using NODE_MODULE_VERSION 51. This version of Node.js requires NODE_MODULE_VERSION 57. Please try re-compiling or re-installing the module (for instance, using `npm rebuild` or `npm install`). … Read more

Delete node_modules folder recursively from a specified path using command line

I have multiple npm projects saved in a local directory. Now I want to take backup of my projects without the node_modules folder, as it is taking a lot of space and can also be retrieved any time using npm install. So, I need a solution to delete all node_modules folders recursively from a specified … Read more

How to include scripts located inside the node_modules folder?

I have a question concerning best practice for including node_modules into a HTML website. Imagine I have Bootstrap inside my node_modules folder. Now for the production version of the website, how would I include the Bootstrap script and CSS files located inside the node_modules folder? Does it make sense to leave Bootstrap inside that folder … Read more

Cannot install NodeJs: /usr/bin/env: node: No such file or directory

I’m trying to install nodeJs into my Ubuntu 14.04 in order to use GruntJs. I’ve read about Ubuntu different way of doing it (issues?), so this is what I’ve done in order to install it: sudo apt-get install npm sudo npm install -g grunt-cli Typing grunt after that I’ve got the error: /usr/bin/env: node: No … Read more

SyntaxError: Cannot use import statement outside a module

I’ve got an ApolloServer project that’s giving me trouble, so I thought I might update it and ran into issues when using the latest Babel. My “index.js” is: require(‘dotenv’).config() import {startServer} from ‘./server’ startServer() And when I run it I get the error SyntaxError: Cannot use import statement outside a module First I tried doing … Read more

How to use executables from a package installed locally in node_modules?

How do I use a local version of a module in node.js. For example, in my app, I installed coffee-script: npm install coffee-script This installs it in ./node_modules and the coffee command is in ./node_modules/.bin/coffee. Is there a way to run this command when I’m in my project’s main folder? I guess I’m looking for … Read more