Running Gulp Works on One Computer, Not Another - node.js

I've got a project of mine that works perfectly fine on my MacBook Air. When I run gulp it runs my default task and serves my site to me.
On my iMac however, when I git clone the same repo, cd into that directory and run npm install, it begins the install and then gives me this error.
npm ERR! cb() never called!
When I run gulp, I get this error:
Error: `libsass` bindings not found. Try reinstalling `node-sass`?
Any idea why this works on one computer and not the other? Any help is appreciated. Thanks in advance!

You're missing libsass c bindings.
There are multiple reasons why this could be. Check that your npm version and node and gulp-sass and node-sass versions are identical.
There's also several issues, but I think this one fits your case best based on the vague description available. https://github.com/dlmanning/gulp-sass/issues/174

Related

Semantic-ui trying to run gulp build but none of its dependencies are installed

I'm trying to install them all manually one at a time, so hopefully it works, but why is this necessary? the documentation asks me to run the command from within the semantic folder where npm install does nothing to rectify it, and gulp build fails because none of the dependencies are there? Scratching my head.
Nevermind, I reinstalled in a different folder, and tried again and it worked properly without intervention this time. Not sure what went wrong.

Starting node server gives node fibers error

I was working on node. Everything was fine. I reinstalled my windows and now when I start node server, it gives me the following error.
I reinstalled fibers as well but still the same issue. Any guesses what I should do?
Thats sounds to me for reinstalling node.js completely, see e.g. this post.
The hard thing is to install the globale modules (those which you have installed with npm -g before you've started the project). From your project make a copy without the node_modules and enter npm install. This worked for me, but I have to deal with the error messages which are missing the global modules.

Cannot find module dtrace-provider

I have a simple nodejs application that is throwing "Cannot find module './build/Release/DTraceProviderBindings'". I look it up online and it looks like that a lot of people are having the same problem when using restify on windows (which is my case, I'm using restify on windows 10). Apparently, dtrace-provider is a optional module for restify and there is no version of it for windows. So, what I tried so far:
Update node to v6.2.0;
Uninstall all modules and run npm install --no-optional;
Uninstall only restify and run npm install restify --no-optional;
And my most desperate move npm install dtrace-provider.
Everything I tried where found on github issues, I've seen same error on OSX users with other modules. Not sure what else to try.
Note: This exception does not stop my application, not even prints the error on the console, I just notice that this was happening using the debugger, in other words, my application runs fine, but this keeps happening on the background.
List of other modules I'm using:
"dependencies": {
"restify": "latest",
"request": ">=2.11.1",
"cheerio": ">=0.10.0",
"xml2js": ">=0.2.0",
"botbuilder": "^0.11.1",
"applicationinsights": "latest"
}
This worked for me after switching to Node 6.1 (and when re-installing node modules didn't work):
Install and save dtrace-provider
$ npm install dtrace-provider --save
Delete 'node_modules' folder
Re-install node modules
$ npm install
I found this thread before combining your attempts with another solution on the Github project issues for restify (https://github.com/restify/node-restify/issues/1093) and simplified best as possible.
I recently ran into this error as well on node 6.11.1.
I ran npm rebuild dtrace-provider and that resolved the problem.
The restify team followed an approach of trying to load the module by requiring it on a try/catch block. You should just ignore the exception.
I had success with the following (elaborate) sequence:
Adjust my path to not have spaces
rm -rf node_modules
rm -rf ~/Library/Caches/node-gyp/
npm cache clean --force
V=1 npm install -S dtrace-provider#0.8.8 --python=python2.7 (repeat this step, resolving as you go, until the install is completely successful … if it fails, check the version - I had rogue dtrace-provider#0.6.0 building at one point)
npm install
At this point everything should have installed cleanly, and I was congratulating myself on a job well done. Then I executed my code and still got the DTraceProviderBindings error. The cause was nested dependencies with the wrong version of dtrace-provider (especially bunyan).
To confirm, do npm list | grep dtrace -B6.
If there's anything lower than 0.8.8, edit package-lock.json, following the method in How do I override nested NPM dependency versions?. Replace requires with dependencies for dtrace-provider and update the version.
Back round to get everything clean: rm -rf node_modules
Then, again, npm install --python=python2.7
I had to iterate round npm list a few times because I thought I'd caught everything and I hadn't.
The key points were to use the required version of python, have a unix-friendly path, and hunt down all nested dependencies. The python version issues gave a big messy error, the space issue gave a much more missable error.
I know this is an old issue but I wanted to comment on it in case anyone else has the same issue I had.
My issue was caused by having parentheses in my path.
/users/karlgroves/Dropbox (Personal)/foo/bar/bat/project...
Moving the project to a path without the parens worked for me.
You'll need to wipe out node_modules and reinstall again.
I recently ran into this error as well on node v8.8.1
as #Derek mentioned, I ran npm rebuild dtrace-provider and that resolved the problem.
tl;dr; dtrace-provider utilized node-gyp which required python version >= 2.5 and NOT 3.5
I had this issue on OSX and found a post that showed using environment variable
V=/Users/your_user/your_project npm i dtrace-provider
This let me know that there was a dependency on node-gyp that was failing to build...Once I knew the issue was with this module was able to focus my attention at troubleshooting node-gyp.
This led to some log output indicating that my python version 3.5 was unsupported and it required version >= 2.5.
Went and downloaded python 2.7.x and checked /usr/bin/python 2.7.x to ensure it was there. Uninstalled the node module that was ultimately requiring this module, then used npm cache clean then reinstalled the module and this time it appeared to pick up the right python version to be able to build.
Hope this helps someone =)
I have tried many suggestions but get the same error again.
Finally, I found the correct way to solve this question.
Go the node.js website and download the latest version of node.js pkg.
After installed, reinstall your software, everything will be ok.
i managed to get this working by running this command
npm install --python=python2.7

Npm 2.x errors on Windows

I have installed NodeJs 4.2.1 and Npm 2.14.7 successfully on Windows 10 x64, but when at the time of gathering dependencies on my new and clean system I'm having several errors. This is what I have done so far:
I have cloned many examples from take: github https://github.com/developit/express-es6-rest-api to name one, when I run npm install on it everything works fine, but when I run npm start it raises errors for missing packages for instance: babel-core/register, utf8, requests, etc. It seems that npm is not installing the 2nd dependency level way down. How can I fix this?, as I said before I've tried with several tutorials and even with something mine and everything is the same. I need a hand, noob on NodeJS here.

libsass bindings not found when running gulp dist

I'm trying to use a gulp project on my Linux machine. The readme for the project tells me to first run sudo npm install -g gulp bower, then in the project directory run sudo npm install and then bower install. Everything up to this point works just fine for me. However, after that I try to run gulp dist and get this error:
Error: `libsass` bindings not found in /[PROJECT DIRECTORY]/trunk/node_modules/gulp-sass/node_modules/node-sass/vendor/linux-x64-14/binding.node. Try reinstalling `node-sass`?
Googling that error produced this: libsass bindings not found when using node-sass in nodejs, which I tried, but that didn't fix anything. When I looked through that directory that gulp said it couldn't find the difference was the linux-x64-14, mine said linux-x64-11, so I'm assuming I have the wrong version? Just for fun I decided to try changing the name of that folder to what it wanted, and I got a different error:
Error: Module did not self-register.
The really strange thing about all this is that when I tried getting this project working on my Windows machine I didn't have any of these issues, it just worked. I have no idea what I'm doing wrong, any ideas?
I've solved this by updating GCC from 4.4.x to 4.7.x.
Because GCC 4.4.x cannot compile node-sass of current version.
It worked for me using below commands. Try it
npm rebuild node-sass
rm -rf node_modules
npm i
This error usually shows up for us when we update our node or io.js version.
I would recommend deleting your node_modules folder and running npm install again.
If that doesn't work it is probably worth deleting your npm cache. There are a number of ways to do it including just a simple npm cache clean
I would also recommend deleting your ~/.npm folder as well just to be sure.
If this doesn't work let me know and we can start debugging your actual Node version and your package.json

Resources