I'm trying to build a front-end server and when I run grunt I get this error with a suggestion to reinstall node-sass.
Aborted due to warnings.
dev@ubuntu:~/ideaProjects/web-app$ grunt app:dashboard/dev-dashboard --force
Loading "sass.js" tasks...ERROR
Error: `/home/dev/ideaProjects/web-app/node_modules/grunt-sass/node_modules/node-sass/bin/linux-x64-v8-3.28/binding.node` is missing.
Try reinstalling `node-sass`?
The weird thing is that the file (binding.node) does exist, but it is in a folder named 'linux-x64-v8-3.14' not, 3.28. I tried naming the folder 3.14 that didn't work. I've tried everything I can thing of to get this fixed, npm install node-sass, npm update, even cleaning out the project and running npm install on a fresh build. But to no avail. I repeatedly get this error.
Has anyone seen this or know how to fix this? I am running Ubuntu 14.04 x64
Thanks!
I ran into basically the same error on Debian Linux with gulp-sass(basically same thing as grunt-sass but for gulp... both are just wrappers for the respective tool around node-sass which is a nodejs port of the actual SASS compiler libsass).
The node-sass project mentions in their README.md that only binaries for "popular platforms"(apparently Windows/Mac) are included and you may need to build for other platforms.
I was able to resolve the issue by explicitly re-running the install and build scripts for node-sass directly on the Debian machine. Here are roughly the steps:
cd node_modules/grunt-sass/node_modules/node-sass
based on your original postnode scripts/install.js
node scripts/build.js
Binary is fine; exiting.
. This will have added the correct node-sass binary for the platform the scripts were run on.I just ran npm install to install the project dependencies. Is there >something else I should run?(I'm new to web development. I'm a java/android >developer)
I do not thinks so. A basic set up, a project folder:
.
├── Gruntfile.js
├── node_modules
└── sass
└── main.scss
Gruntfile.js contains:
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-sass');
grunt.initConfig({
sass: {
options: {
sourceMap: true
},
dist: {
files: {
'css/main.css': 'sass/main.scss'
}
}
}
});
grunt.registerTask('default', ['sass']);
}
then run:
npm install grunt-sass
Now you should be able to run:
grunt
the above outputs now:
Running "sass:dist" (sass) task
Done, without errors.
Notice that the npm install grunt-sass
commands should output something like that shown below, possible related to your error:
/
> [email protected] install /home/testdrive/sassgrunt/node_modules/grunt-sass/node_modules/node-sass
> node scripts/install.js
Binary downloaded and installed at /home/testdrive/sassgrunt/node_modules/grunt-sass/node_modules/node-sass/vendor/linux-x64-14/binding.node
> [email protected] postinstall /home/testdrive/sassgrunt/node_modules/grunt-sass/node_modules/node-sass
> node scripts/build.js
` /home/testdrive/sassgrunt/node_modules/grunt-sass/node_modules/node-sass/vendor/linux-x64-14/binding.node ` exists.
testing binary.
Binary is fine; exiting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With