-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Installing node-sass and rebuilding/using it results in module not found #1981
Comments
Installing with I have tried the following snippet in both var sass = require('node-sass');
sass.render({
file: 'test.scss'
}, function(err, result) {
result && console.log(result);
}); So, I would suggest you to do a |
I can confirm that |
Running
|
@aouaki, can you run |
@bestander Doesn't change anything 😞. I don't think that heroku's deployments use yarn's cache anyway. @hassankhan do you still have the issue ? |
Haven't yet had the chance to update Yarn and check, will do later today and report back |
I'm facing the same issue when deploying to Heroku. I'm using yarn 0.18.1. I declare that in the "engines" section of package.json, which Heroku honors.
```
remote: -----> Installing binaries
remote: engines.node (package.json): 6.3.0
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Downloading and installing node 6.3.0...
remote: Using default npm version: 3.10.3
remote: Downloading and installing yarn (0.18.1)...
remote: Installed yarn 0.18.1
```
The first build after clearing Heroku's build cache succeeds. Further builds fail to compile my SASS stylesheets with webpack beacuse node-sass fails to find the
```
remote: ERROR in ./amalfi/documents/main.sass
remote: Module build failed: ModuleBuildError: Module build failed: Error: ENOENT: no such file or directory, scandir '/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/node-sass/vendor'
remote: at Error (native)
remote: at Object.fs.readdirSync (fs.js:951:18)
remote: at Object.getInstalledBinaries (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/node-sass/lib/extensions.js:122:13)
remote: at foundBinariesList (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/node-sass/lib/errors.js:20:15)
remote: at foundBinaries (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/node-sass/lib/errors.js:15:5)
remote: at Object.module.exports.missingBinary (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/node-sass/lib/errors.js:45:5)
remote: at module.exports (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/node-sass/lib/binding.js:15:30)
remote: at Object. (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/node-sass/lib/index.js:14:35)
remote: at Module._compile (module.js:541:32)
remote: at Object.Module._extensions..js (module.js:550:10)
remote: at Module.load (module.js:458:32)
remote: at tryModuleLoad (module.js:417:12)
remote: at Function.Module._load (module.js:409:3)
remote: at Module.require (module.js:468:17)
remote: at require (internal/module.js:20:19)
remote: at Object. (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/sass-loader/index.js:4:12)
remote: at Module._compile (module.js:541:32)
remote: at Object.Module._extensions..js (module.js:550:10)
remote: at Module.load (module.js:458:32)
remote: at tryModuleLoad (module.js:417:12)
remote: at Function.Module._load (module.js:409:3)
remote: at Module.require (module.js:468:17)
remote: at require (internal/module.js:20:19)
remote: at loadLoader (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/loader-runner/lib/loadLoader.js:13:17)
remote: at iteratePitchingLoaders (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/loader-runner/lib/LoaderRunner.js:164:2)
remote: at iteratePitchingLoaders (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/loader-runner/lib/LoaderRunner.js:160:10)
remote: at /tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/loader-runner/lib/LoaderRunner.js:168:18
remote: at loadLoader (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/loader-runner/lib/loadLoader.js:36:3)
remote: at iteratePitchingLoaders (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/loader-runner/lib/LoaderRunner.js:164:2)
remote: at runLoaders (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/loader-runner/lib/LoaderRunner.js:357:2)
remote: at /tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/webpack/lib/NormalModule.js:143:35
remote: at /tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/loader-runner/lib/LoaderRunner.js:359:11
remote: at /tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/loader-runner/lib/LoaderRunner.js:165:18
remote: at loadLoader (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/loader-runner/lib/loadLoader.js:27:11)
remote: at iteratePitchingLoaders (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/loader-runner/lib/LoaderRunner.js:164:2)
remote: at iteratePitchingLoaders (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/loader-runner/lib/LoaderRunner.js:160:10)
remote: at /tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/loader-runner/lib/LoaderRunner.js:168:18
remote: at loadLoader (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/loader-runner/lib/loadLoader.js:36:3)
remote: at iteratePitchingLoaders (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/loader-runner/lib/LoaderRunner.js:164:2)
remote: at runLoaders (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/loader-runner/lib/LoaderRunner.js:357:2)
remote: at NormalModule.doBuild (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/webpack/lib/NormalModule.js:131:2)
remote: at NormalModule.build (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/webpack/lib/NormalModule.js:182:15)
remote: at Compilation.buildModule (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/webpack/lib/Compilation.js:129:9)
remote: at Compilation. (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/webpack/lib/Compilation.js:406:8)
remote: at /tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/webpack/lib/NormalModuleFactory.js:243:4
remote: at /tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/webpack/lib/NormalModuleFactory.js:94:13
remote: at /tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/tapable/lib/Tapable.js:168:11
remote: at NormalModuleFactory. (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/webpack/lib/CompatibilityPlugin.js:52:4)
remote: at NormalModuleFactory.applyPluginsAsyncWaterfall (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/tapable/lib/Tapable.js:172:13)
remote: at onDoneResolving (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/webpack/lib/NormalModuleFactory.js:69:11)
remote: at onDoneResolving (/tmp/build_fecf70d99758306b4e17bbcbf75d69fa/node_modules/webpack/lib/NormalModuleFactory.js:190:6)
remote: at _combinedTickCallback (internal/process/next_tick.js:67:7)
remote: at process._tickCallback (internal/process/next_tick.js:98:9)
```
As a workaround, I added:
to my deployment script, after installing dependencies but before running webpack. This allows me to deploy my app with yarn, but negates most of the speed advantage of yarn over npm (it feel like 3 x 15 seconds instead of 1 x 45 seconds — I didn't time it precisely). |
I came across multiple reports of this issue in the node-sass and yarn repositories. Maintainers of node-sass believe it's a bug in yarn. It would be useful to consolidate discussions in one issue, in the repository of the project where the fix belongs. |
@aaugustin: Did you run…
…in |
I added it in I'm not relying on Heroku's automatic build hooks, I'm doing everything manually in Hope this helps! |
…ps update If you `yarn add --force node-sass` after `yarn`, there will be enough `node-sass` around for the build to run. see yarnpkg/yarn#1981 Change all deps to squiggly versions in the package.json and regenerate yarn with latest everything
Same issue here, while using Yarn (0.21.3). It's failing at Heroku build (node-sass error). Even the suggested workaround did not work for me ( |
How can we help triage/confirm this? I can easily reproduce this using Travis CI and CircleCI. |
It looks like a node_modules cache issue within Heroku while using Yarn. When I set the config vars in Heroku to disable cache for node_modules, the build and the deployment went through fine. Not sure, how long will we need to keep clearing node_modules cache while using Yarn. |
It's not specific to Heroku. We had to deploy workarounds on Travis CI and CircleCI. I also had it fail locally at least once when upgrading but that's not trivial to replicate. |
I can confirm this affects Docker as well. I'm using yarn 0.21.3. Including the remove/add workaround in my startup script solves the problem. |
Can anyone provide a clear repro step with latest version of Yarn? |
I encountered same problem on yarn 0.22.0... |
Same issue here on 0.23, every time I run |
We're still getting this issue on two of our apps (using yarn
(It seemed to work for some builds for a while, maybe it happened again when we updated packages or something?) |
This unfortunately seemed to only temporarily fix the issue for us also. @bestander perhaps this should be reopened? Or should we create a new issue? |
I'm seeing this issue with v0.24.5 and bcrypt - different package, same problem. |
New issue with repro steps is the best way to go
…On Fri, 19 May 2017 at 05:10, Dan Coates ***@***.***> wrote:
This unfortunately seemed to only temporarily fix the issue for us also.
@bestander <https://github.com/bestander> perhaps this should be
reopened? Or should we create a new issue?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1981 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACBdWNlHiwfn_QCNzfv6S8_9a0P3U6mZks5r7RY-gaJpZM4K5Tsx>
.
|
References: yarnpkg/yarn#1981 (comment) adopted-ember-addons/ember-paper@42db2c8 Should be able to revert once this issues is closed in sass/node-sass sass/node-sass#1804
I am using Yarn v0.24.6 and it has the same issue with node-sass rebuilding, as described here. |
I still see this on Heroku today after making the move from |
This issue has got even worse since I think v0.24.6, now it ruins node-sass every time I add a new library to the project. This is happening to me and other people in my team on different projects. I will try to find some time to investigate or at least create a reproducible example. |
Thanks, Michal.
A repro step is very important.
Considering the number of comments in this issue please raise a new issue
with the repro steps and ping me, we'll sort it out
…On 29 June 2017 at 00:42, Michał Matyas ***@***.***> wrote:
This issue has got even worse since I think v0.24.6, now it ruins
node-sass every time I add a new library to the project. This is happening
to me and other people in my team on different projects. I will try to find
some time to investigate or at least create a reproducible example.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1981 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACBdWKVRUba4FAf2kqDly80RUjaP3TS4ks5sI1V4gaJpZM4K5Tsx>
.
|
@bestander apologizes, seems that the bug I found is a mixture of Yarn bug and user behaviour and it might be completely unrelated to this issue. I have created a separate issue - #3752 - but since it's necessary for the user to make a mistake first, I'd say it's definitely lower priority than I initially suspected :) Sorry for the extra noise! |
|
|
* Add app.json and modify client/package.json Because of Node-sass issues with yarn Per yarnpkg/yarn#1981 (comment)
* Add app.json and modify client/package.json Because of Node-sass issues with yarn Per yarnpkg/yarn#1981 (comment)
Hello,
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
I install node-sass@^3.13.0 using yarn 0.17.8. I then run
npm rebuild node-sass
and it outputs :Error: Cannot find module 'sax'
The missing is sometimes different (happened to be
has
too).It also happens without running
npm rebuild node-sass
. When using node-sass without rebuilding it, I encounter the same error.Logs
Versions :
OS: Heroku VM using yarn node.js buildpack (https://github.com/heroku/heroku-buildpack-nodejs/tree/yarn)
yarn: 0.17.8
node-sass: 3.13.0
npm: 3.10.9
node: LTS and latest tried
Could be related to sass/node-sass#1804 but on this issue they say it's fixed on yarn v0.17.7, while on 0.17.8 it isn't for me.
Thanks,
Arthur
The text was updated successfully, but these errors were encountered: