Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
g1eb opened this issue Jun 2, 2017 · 6 comments
Closed

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

g1eb opened this issue Jun 2, 2017 · 6 comments

Comments

@g1eb
Copy link

g1eb commented Jun 2, 2017

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.

@jvandemo
Copy link
Owner

jvandemo commented Jun 4, 2017

@deblockt — Would you be able to have a look at this, please? Thanks in advance!

@brentchow
Copy link

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

npm rebuild node-sass

sass/node-sass#1918

@brentchow
Copy link

PS I've found that yarn node-sass --force does not resolve the issue.

@jvandemo
Copy link
Owner

@g1eb — Can you please try @brentchow's advice and let us know how it goes?

@brentchow — Thank you for your help, much appreciated! 👍

@g1eb
Copy link
Author

g1eb commented Jun 16, 2017

yeah npm rebuild node-sass works 👍

turns out it's a wrapper for the install.js and build.js node-sass scripts that I used to solve this before log

@g1eb g1eb closed this as completed Jun 16, 2017
@jvandemo
Copy link
Owner

@g1eb — Awesome, thank you for the update 👍

@brentchow — Thank you for providing a solution 🏆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants