Erreur: La liaison `libsass` n’a pas été trouvée

Exécuter l’application express en utilisant node-sass-middleware me donne cette erreur sur Ubuntu:

0 info it worked if it ends with ok 1 verbose cli [ '/home/mohamed/.nvm/versions/node/v0.12.7/bin/node', 1 verbose cli '/home/mohamed/.nvm/versions/node/v0.12.7/bin/npm', 1 verbose cli 'start' ] 2 info using [email protected] 3 info using [email protected] 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info prestart [email protected] 6 info start [email protected] 7 verbose unsafe-perm in lifecycle true 8 info [email protected] Failed to exec start script 9 verbose stack Error: [email protected] start: `node app.js` 9 verbose stack Exit status 1 9 verbose stack at EventEmitter. (/home/mohamed/.nvm/versions/node/v0.12.7/lib/node_modules/npm/lib/utils/lifecycle.js:213:16) 9 verbose stack at EventEmitter.emit (events.js:110:17) 9 verbose stack at ChildProcess. (/home/mohamed/.nvm/versions/node/v0.12.7/lib/node_modules/npm/lib/utils/spawn.js:24:14) 9 verbose stack at ChildProcess.emit (events.js:110:17) 9 verbose stack at maybeClose (child_process.js:1015:16) 9 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:1087:5) 10 verbose pkgid [email protected] 11 verbose cwd /home/mohamed/projects/arabicoders 12 error Linux 3.19.0-28-generic 13 error argv "/home/mohamed/.nvm/versions/node/v0.12.7/bin/node" "/home/mohamed/.nvm/versions/node/v0.12.7/bin/npm" "start" 14 error node v0.12.7 15 error npm v2.11.3 16 error code ELIFECYCLE 17 error [email protected] start: `node app.js` 17 error Exit status 1 18 error Failed at the [email protected] start script 'node app.js'. 18 error This is most likely a problem with the arabicoders package, 18 error not with npm itself. 18 error Tell the author that this fails on your system: 18 error node app.js 18 error You can get their info via: 18 error npm owner ls arabicoders 18 error There is likely additional logging output above. 19 verbose exit [ 1, true ] 

Cela peut être dû à des versions de noeud incompatibles. Par exemple, si vous mettez à jour de 0,12 à 4.x ou 5.x, vous devrez soit réinstaller libsass, soit le reconstruire avec la commande npm rebuild node-sass .

On dirait que vous n’avez pas installé sass ou node-sass .

Essayez avec:

 sudo su -c "gem install sass" 

et

 npm install -g node-sass 

Exécutez-vous npm rebuild node-sass après avoir exécuté l’ npm install ? Cela a réglé le problème pour moi.

Si vous utilisez NVM, il est recommandé d’installer et d’utiliser la version LTS (actuellement la version 4.3.3). Faites-le en utilisant nvm install 4.3.3 && nvm use 4.3.3