question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm run build in a generated library fails on node-sass dependency

See original GitHub issue

First of all, thanks for making this generator, really helped me understand what format angular wants to use in order to publish a compatible library.

I just wanted to mention that on a freshly generated project I run into this error:

gleb@G1B:~/work/ng2-lib$ npm run build

> ng2-lib@0.1.0 build /home/gleb/work/ng2-lib
> gulp build

fs.js:870
  return binding.readdir(pathModule._makeLong(path), options.encoding);
                 ^

Error: ENOENT: no such file or directory, scandir '/home/gleb/work/ng2-lib/node_modules/node-sass/vendor'
    at Object.fs.readdirSync (fs.js:870:18)
    at Object.getInstalledBinaries (/home/gleb/work/ng2-lib/node_modules/node-sass/lib/extensions.js:124:13)
    at foundBinariesList (/home/gleb/work/ng2-lib/node_modules/node-sass/lib/errors.js:20:15)
    at foundBinaries (/home/gleb/work/ng2-lib/node_modules/node-sass/lib/errors.js:15:5)
    at Object.module.exports.missingBinary (/home/gleb/work/ng2-lib/node_modules/node-sass/lib/errors.js:45:5)
    at module.exports (/home/gleb/work/ng2-lib/node_modules/node-sass/lib/binding.js:15:30)
    at Object.<anonymous> (/home/gleb/work/ng2-lib/node_modules/node-sass/lib/index.js:14:35)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)

npm ERR! Linux 3.16.0-4-amd64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v7.2.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! ng2-lib@0.1.0 build: `gulp build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ng2-lib@0.1.0 build script 'gulp build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ng2-lib package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ng2-lib
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls ng2-lib
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/gleb/work/ng2-lib/npm-debug.log

I could solve it by manually running these two commands:

node node_modules/node-sass/scripts/install.js
node node_modules/node-sass/scripts/build.js

Versions:

node: v7.2.1
npm: 3.10.10
yo: 1.8.5
generator-angular2-library: 10.2.2

Running on Debian 8.0 x64

This happens every time I create a new library with generator-angular2-library. Not sure if it’s an issue this generator or node-sass dependency, just wanted to let you know.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

11reactions
brentchowcommented, Jun 14, 2017

Seems to be a common node v6 issue with node-sass. Running this should resolve:

npm rebuild node-sass

https://github.com/sass/node-sass/issues/1918

0reactions
jvandemocommented, Jun 17, 2017

@g1eb — Awesome, thank you for the update 👍

@brentchow — Thank you for providing a solution 🏆

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error with node-sass when running npm install - Stack Overflow
node-sass has been deprecated. It has been transformed to the npm package sass now. You can uninstall the old and install the new...
Read more >
Angular 7 npm install error due to node-sass, node-gyp ...
We figured that this was due to an underlying problem with Angular's internal dependencies and Node itself, but never investigated the root ...
Read more >
node-sass - npm
Node-sass is a library that provides binding for Node.js to LibSass, the C version of the popular stylesheet preprocessor, Sass. It allows you ......
Read more >
error: node sass does not yet support your current environment
You can build it by running the following command: npm ... run npm rebuild node-sass ... Web\nodemodules\node-sass\lib\binding.js:13 throw new Error(errors.
Read more >
gulp-sass - node_modules - node-sass
Build status npm version Dependency Status devDependency Status Coverage Status ... Node-sass is a library that provides binding for Node.js to libsass, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found