Steps I did:
npm install yarn -gnode_modules and yarn.lock from my project's rootyarn to install dependencies from project's package.json (including node-sass 3.12.2)Result:
fs.js:951
return binding.readdir(pathModule._makeLong(path), options.encoding);
^
Error: ENOENT: no such file or directory, scandir '/home/jbruni/project/node_modules/node-sass/vendor'
at Error (native)
at Object.fs.readdirSync (fs.js:951:18)
at Object.getInstalledBinaries (/home/jbruni/project/node_modules/node-sass/lib/extensions.js:121:13)
at foundBinariesList (/home/jbruni/project/node_modules/node-sass/lib/errors.js:20:15)
at foundBinaries (/home/jbruni/project/node_modules/node-sass/lib/errors.js:15:5)
at Object.module.exports.missingBinary (/home/jbruni/project/node_modules/node-sass/lib/errors.js:45:5)
at module.exports (/home/jbruni/project/node_modules/node-sass/lib/binding.js:15:30)
at Object.<anonymous> (/home/jbruni/project/node_modules/node-sass/lib/index.js:14:35)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
Important:
If I do npm rebuild node-sass and run the task again, everything goes well. The error vanishes.
I have done the procedure described in the steps above several times lately, and it has been working.
It seems Yarn used to automatically run the "build node-sass" process, but it is not doing anymore.
I can't tell if this is due to Yarn (likely to be) or node-sass, because both had new releases today. I'm only reporting for your acknowledgement, so you can proceed with the appropriate action.
Thank you.
yarn --version): 0.17.0npm -v): 3.10.8node -v): v6.7.0node -p process.versions): { http_parser: '2.7.0',
node: '6.7.0',
v8: '5.1.281.83',
uv: '1.9.1',
zlib: '1.2.8',
ares: '1.10.1-DEV',
icu: '57.1',
modules: '48',
openssl: '1.0.2j' }
node -p process.platform): linuxnode -p process.arch): x64node -p "require('node-sass').info"):node-sass 3.12.2 (Wrapper) [JavaScript]
libsass 3.3.6 (Sass Compiler) [C/C++]
npm ls node-sass):/home/jbruni/project
└── [email protected]
Thanks for the report. Could you please create gist with full install log output?
@xzyfer - here is it: https://gist.github.com/jbruni/e089a168b7070bc27c0bed6f78da678f
Nothing interesting, except (perhaps) by the absence of the final lines where (as far as I remember) node-sass build happened and appeared in the output...
Is there a more verbose output mode?
I just a did a local test with both yarn 0.16.1 and 0.17.0 against [email protected] without any issue.
I have an internal project that has the same behavior/workaround.
Yarn 0.17.0 (with lockfile)
node-sass version 3.4.1
node-ass was previously installed fine with Yarn 0.16.1.
Hmm [email protected] has been stable for a long time. This appears to be a yarn issue.
I'm having this issue with npm (not using yarn).
Looks like it's expecting a file from a package called gauge (which is pulled in by npmlog) but not finding it.
> [email protected] install /mnt/ephemeral/var/lib/jenkins/jobs/FE_SEO_Release_QA/workspace/node_modules/node-sass
> node scripts/install.js
http node-sass install Downloading binary from https://github.com/sass/node-sass/releases/download/v3.12.3/linux-x64-14_binding.node
[?25l
[K[?25h/mnt/ephemeral/var/lib/jenkins/jobs/FE_SEO_Release_QA/workspace/node_modules/gauge/render-template.js:67
throw new error.MissingTemplateValue(cloned, values)
^
Error: Missing template value "progressbar"
at cloneAndObjectify (/mnt/ephemeral/var/lib/jenkins/jobs/FE_SEO_Release_QA/workspace/node_modules/gauge/render-template.js:67:17)
at Array.map (native)
at prepareItems (/mnt/ephemeral/var/lib/jenkins/jobs/FE_SEO_Release_QA/workspace/node_modules/gauge/render-template.js:83:25)
at module.exports (/mnt/ephemeral/var/lib/jenkins/jobs/FE_SEO_Release_QA/workspace/node_modules/gauge/render-template.js:16:15)
at Object.Plumbing.show (/mnt/ephemeral/var/lib/jenkins/jobs/FE_SEO_Release_QA/workspace/node_modules/gauge/plumbing.js:45:10)
at Object.Gauge._doRedraw (/mnt/ephemeral/var/lib/jenkins/jobs/FE_SEO_Release_QA/workspace/node_modules/gauge/index.js:219:40)
at null.<anonymous> (/mnt/ephemeral/var/lib/jenkins/jobs/FE_SEO_Release_QA/workspace/node_modules/gauge/index.js:15:19)
at wrapper (timers.js:274:14)
at Timer.unrefdHandle (timers.js:307:14)
@bpossolo you issue is unrelated and fixed in v3.12.5
@xzyfer - I tried but couldn't find more verbose output. Now I'm getting this other error. Latest Yarn became unusable for me. I reverted to previous released version (yarn 0.16.1), and I have no issues anymore. Everything installs just fine, including node-sass.
And yes: in the end of the process, I can see it quickly building (or downloading) node-sass in the progress status. This is absent when using Yarn 0.17.0
I think we can close this issue, since all evidences point to being a Yarn issue.
Thanks all
I was getting the same error! I just migrated my project from npm to yarn but when i use gulp dev i got the error as mentioned in the beginning. I copied the vendor folder from node_modules of npm install to node_modules of yarn and everything was perfect after that.
Latest [email protected] fixed issue for me.
I m using the same yarn version! :(
@viswanathamsantosh maybe remove node_modules and yarn install again?
Yup! did it but still didn't worked.may be i will try on other machine and check.
Yes, using Yarn 0.17.2 works. They reverted the change that introduced the bug.
This works fine for me in yarn 0.16.1, but still broken in yarn 0.17.x. Removed node_modules, reinstalled yarn then reran it when testing.
I can confirm the issue persist with 0.17.2, npm rebuild node-sass helped.
ERROR in ENOENT: no such file or directory, scandir 'node_modules/node-sass/vendor'
$ npm rebuild node-sass
> [email protected] install node_modules/node-sass
> node scripts/install.js
Binary downloaded and installed at node_modules/node-sass/vendor/darwin-x64-48
/binding.node
> [email protected] postinstall node_modules/node-sass
> node scripts/build.js
"node_modules/node-sass/vendor/darwin-x64-48/binding.node" exists.
testing binary.
Binary is fine; exiting.
I can confirm with yarn 0.17.4.
@hauleth are you confirming the issue persists or is resolved in 0.17.4?
I can confirm issue persists with 0.17.6, have to do yarn && npm rebuild node-sass
@hauleth, @firedev, can you check whether this fixes your problems?
yarn cache clean
rm -rf node_modules
yarn install
It was suggested in https://github.com/yarnpkg/yarn/issues/1832#issuecomment-261572795
@firedev I can't confirm. I had problems with 0.17.0 but when testing 0.17.2, 0.17.4 and 0.17.6 - it works fine on my end.
The issue persists for me across all of 0.17.x, up to and including 0.17.6.
It's very difficult to create a reproducible case though. It does not occur in all projects where I use node-sass, and it does not occur consistently on every install.
Cleaning the cache / running yarn --force / removing node_modules may fix the symptoms for a while, but it's very likely that the problem will reappear later.
It worked fine after some voodoo magic. But I agree with @lime that this is band-aid not full time solution.
This could be related to https://github.com/yarnpkg/yarn/pull/1965 which was fixed in v0.17.7. Is someone able to confirm?
@xzyfer Seems fixed for me in v0.17.7 :)
I still have this issue with v0.17.8
same here, still have this issue with v0.17.8
Yep. I had this issue today. 0.17.9 using npm rebuild node-sass fixed things though.
I was having this same issue with 0.17.9 immediately after upgrading from 0.16.9. I think this may have been due to an issue with incompatible caches? After running yarn cache clean && rm -rf node_modules/ && yarn on 0.17, I'm not seeing the issues anymore.
i'm pretty sure it has something to do with caching... i run into this problem on my ci server. node-sass install script downloads the binary and caches it to .npm cache directory. but when using yarn, the cache that gets restored is not the npm cache, but the yarn cache. there is not vendor binary in the yarn cache...
Yes this a known issue with Yarn. We're leaving this issue open until there is a resolution.
Yarn v0.17.10 still has this issue when pushing to Heroku.
Had this issue in yarn 0.17.10 Solved with 'yarn install --force'
I get this error when running grunt sass after installing grunt-sass via npm install:
>> Error: ENOENT: no such file or directory, scandir '/PROJECT_PATH/node_modules/grunt-sass/node_modules/node-sass/vendor'
The /PROJECT_PATH/node_modules/grunt-sass/node_modules/node-sass/vendor directory does not exist. I know from another project that there should be /PROJECT_PATH/node_modules/grunt-sass/node_modules/node-sass/vendor/darwin-x64-46/binding.node file.
npm rebuild node-sass has no effect.
Any thoughts on how to get this build properly?
@jtsternberg It sounds like your issue is unrelated to Yarn. The first step would be to remove your node_modules directory and reinstall from scratch. If that doesn't work, you should probably open a separate issue.
@primavera133 Thanks this works, but the rebuild does add a little bit more time to the build compared to vanilla npm.
Hitting this issue on Heroku with yarn 0.18.1 fwiw.
Yes this a known issue with Yarn. We're leaving this issue open until there is a resolution. Additional comments have been restricted.
I think the problem is that there is no way to tell the packager to carry some files around but only locally. We have previously decided not to include binary bindings in the package itself.
Closing as stale. This is a yarn issue out of our control.
Most helpful comment
Yes this a known issue with Yarn. We're leaving this issue open until there is a resolution.