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

[0.17.0] Issues with node-sass #1832

Closed
hassankhan opened this issue Nov 15, 2016 · 41 comments
Closed

[0.17.0] Issues with node-sass #1832

hassankhan opened this issue Nov 15, 2016 · 41 comments
Labels

Comments

@hassankhan
Copy link

hassankhan commented Nov 15, 2016

What is the current behavior?

yarn install v0.17.0
info No lockfile found.
error npm-shrinkwrap.json found. This will not be updated or respected. See https://yarnpkg.com/en/docs/migrating-from-npm for more information.
[1/4] 🔍  Resolving packages...
warning istanbul > istanbul-api > fileset > minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
[1/2] ⡀ fsevents: sh: node-pre-gyp: command not found
[2/2] ⡀ node-sass
[-/2] ⡀ waiting...
[-/2] ⠐ waiting...
[2/2] ⠐ node-sass:     at Timer.unrefdHandle (timers.js:312:14)
[-/2] ⠐ waiting...
[-/2] ⠐ waiting...
error /Users/hassankhan/Projects/react-dashboard/node_modules/node-sass: Command failed.
Exit code: 1
Command: sh
Arguments: -c node scripts/install.js
Directory: /Users/hassankhan/Projects/react-dashboard/node_modules/node-sass
Output:
http node-sass install Downloading binary from https://github.com/sass/node-sass/releases/download/v3.12.4/darwin-x64-46_binding.node
/Users/hassankhan/Projects/react-dashboard/node_modules/gauge/render-template.js:67
          throw new error.MissingTemplateValue(cloned, values)
          ^

Error: Missing template value "progressbar"
    at cloneAndObjectify (/Users/hassankhan/Projects/react-dashboard/node_modules/gauge/render-template.js:67:17)
    at Array.map (native)
    at prepareItems (/Users/hassankhan/Projects/react-dashboard/node_modules/gauge/render-template.js:83:25)
    at module.exports (/Users/hassankhan/Projects/react-dashboard/node_modules/gauge/render-template.js:16:15)
    at Object.Plumbing.show (/Users/hassankhan/Projects/react-dashboard/node_modules/gauge/plumbing.js:45:10)
    at Object.Gauge._doRedraw (/Users/hassankhan/Projects/react-dashboard/node_modules/gauge/index.js:219:40)
    at null.<anonymous> (/Users/hassankhan/Projects/react-dashboard/node_modules/gauge/index.js:15:19)
    at wrapper (timers.js:275:11)
    at Timer.unrefdHandle (timers.js:312:14)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

If the current behavior is a bug, please provide the steps to reproduce.
Have a package that uses node-sass as a dependency, then run yarn install. Running it a second time will complete the install, but node-sass will not work.

What is the expected behavior?

No errors, just fun.

Please mention your node.js, yarn and operating system version.
Node v4.6.0
Yarn v0.17.0
macOS 10.11.6

@bestander
Copy link
Member

Can't reproduce this with latest master:

~/work/yarn/artifacts/dist/bin/yarn add node-sass
yarn add v0.18.0-0
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Saved lockfile.
success Saved 180 new dependencies.
├─ abbrev@1.0.9
...

@bestander
Copy link
Member

@hassankhan, can you checkout master and try on it?

@asprouse
Copy link

I can confirm this is happening with our CI build with yarn 17. It works when I clear the cache but like @hassankhan mentioned it happens on the second run.

Node v6.1.0
Yarn v0.17.0
ubuntu 14.04

@jswanner
Copy link

I just tried with the latest master, and while I do see Building fresh packages... in the output, I need to run npm rebuild node-sass afterwards in order for the app to run.

Node 7.1.0
Yarn 0.18.0-0
OS X 10.11.6

@jswanner
Copy link

This is now resolved for me with Yarn 0.17.2.

@torifat
Copy link
Member

torifat commented Nov 16, 2016

Closing this. Please feel free to let us know if you face this problem in >= v0.17.2

@torifat torifat closed this as completed Nov 16, 2016
@jswanner
Copy link

I'm sorry, I spoke too soon. I thought I tested this with my postinstall work-around removed, but apparently not. I am still experiencing this problem with v0.17.2.

@torifat
Copy link
Member

torifat commented Nov 17, 2016

@jswanner no worries. Thanks for reporting it back though 😄

@hassankhan
Copy link
Author

Sorry, late to the party, but yeah same thing, no dice 😢

@jesperronn
Copy link

jesperronn commented Nov 17, 2016

FYI on my project (which has a lot of dependencies, but I think this is the problem).

I can see that Yarn (0.17.2) removes some dependencies after a run. Notice the lines stating unbuild ... below:

$ yarn
yarn install v0.17.2
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning Unmet peer dependency "eslint@>=0.16.0".
warning Unmet peer dependency "jasmine-core@*".
warning Unmet peer dependency "request@^2.34".
warning Unmet peer dependency "request@^2.34".
[4/4] 📃  Building fresh packages...
$ bower install && npm prune && bower prune
(node:2271) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.

bower tinymce-dist    extra-resolution Unnecessary resolution: tinymce-dist#4.3.12
unbuild uid-number@0.0.6
unbuild fstream-ignore@1.0.5
unbuild tar-pack@3.3.0
unbuild node-pre-gyp@0.6.31
(node:2298) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
✨  Done in 18.13s.

After the yarn command and the unbuild steps, I get the following error running my tests. Note the failing section is inside node-sass:

$ npm t

> secret_app@0.0.0 test ~/secret_project/
> gulp test

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

Error: ENOENT: no such file or directory, scandir '~/secret_project/node_modules/node-sass/vendor'
    at Error (native)
    at Object.fs.readdirSync (fs.js:951:18)
    at Object.getInstalledBinaries (~/secret_project/node_modules/node-sass/lib/extensions.js:121:13)
    at foundBinariesList (~/secret_project/node_modules/node-sass/lib/errors.js:20:15)
    at foundBinaries (~/secret_project/node_modules/node-sass/lib/errors.js:15:5)
    at Object.module.exports.missingBinary (~/secret_project/node_modules/node-sass/lib/errors.js:45:5)
    at module.exports (~/secret_project/node_modules/node-sass/lib/binding.js:15:30)
    at Object.<anonymous> (~/secret_project/node_modules/node-sass/lib/index.js:14:35)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
npm ERR! Test failed.  See above for more details.

Then, if I run npm rebuild node-sass, I am able to proceed.

But then phantomjs-prebuilt will give the next failure:

17 11 2016 11:18:57.578:ERROR [plugin]: Error during loading "~/secret_project/node_modules/karma-phantomjs-launcher" plugin:
  Path must be a string. Received null

So, the dependencies being unbuilt in the final step are as far as I can see not being removed by npm prune. Somehow npm prune and yarn's unbuild do different things??

@bestander
Copy link
Member

So I am trying to repro on master branch:

$ yarn add node-sass
yarn add v0.18.0-0
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Saved lockfile.
success Saved 180 new dependencies.
├─ abbrev@1.0.9
...
✨  Done in 8.94s.
$ ls -al node_modules/node-sass/vendor/darwin-x64-48/
total 5088
drwxr-xr-x  3 bestander Domain Users      102 Nov 17 16:02 .
drwxr-xr-x  3 bestander  Domain Users      102 Nov 17 16:01 ..
-rw-r--r--  1 bestander  Domain Users  2602136 Nov 17 16:02 binding.node

Everything seems in place.
Can anyone give me a 100% list of commands to reproduce this?
Is it linux/windows only?

I think binding.node is downloaded instead of being rebuilt.
Could that be a reason?

Anyway, we need a step by step guide to repro this

@torifat
Copy link
Member

torifat commented Nov 17, 2016

@bestander it wasn't working me for either. The build step wasn't happening. After a yarn cache clean, it worked.

@lime
Copy link

lime commented Nov 17, 2016

Can anyone give me a 100% list of commands to reproduce this?

This seems to be very difficult to reproduce consistently. 😕 It easily brings up red herrings, since it's likely that something you try at first seemingly fixes it, and then it only resurfaces later.

@STRML has some ongoing work in #1852 (comment) / https://github.com/STRML/yarn-install-lifecycle-bug if someone else manages to get a reliable repro case.

As far as I can see, this looks like the same root issue as #1848, #1852 and #1872, right? Or has there been some indication that there are two separate things going on?

Is it linux/windows only?

OS X 10.11.6 here.

@STRML
Copy link
Contributor

STRML commented Nov 17, 2016

These all seem related.

For those of you currently experiencing it, could you please make copies of your local and homedir .npmrc and .yarnrc, if any, and then try removing them and reinstalling? See if that clears it up. If it does, let's see if there's a common thread among them.

In my case, removing and recreating my .npmrc fixed the issue, even though the new .npmrc had the same content. I can no longer reproduce the bug.

@hassankhan
Copy link
Author

hassankhan commented Nov 17, 2016

So just updated to Yarn 0.17.4 and running yarn doesn't result in any errors for me any more. I would close the issue, but others seem to still be having problems.

@bestander
Copy link
Member

Yes they all seem related.
#1817, related as well, got fixed between 0.17.0 and 0.17.3

@wyze
Copy link
Member

wyze commented Nov 17, 2016

@hassankhan, if you run yarn cache clean && rm -rf node_modules, it should reproduce this.

@victornoel
Copy link
Contributor

I had the same problem, removing node-sass from the cache fixed it on the next run.

I also noticed some segmentation fault while running yarn on projects with a lot of dependencies and the cache was empty, and after it happened, node-sass had been put in the node_modules folder, but vendor wasn't there. So I suspect that the segmentation fault happens when the post install scripts are run.
And then people re-run yarn and yarn thinks node-sass is properly installed, which is not the case.

Something like that... but I can't find the error log anymore with yarn 0.17.3....

@hassankhan
Copy link
Author

@wyze Nope, did what you said but I can't reproduce the error any more. Seems to be working fine now 👍

@bestander
Copy link
Member

#1912 is important to fix - Yarn silences build errors and this leaves us with inconsistent state

@dbashford
Copy link

Is this still a thing with 0.17.4? Hard to track if it is fixed or not.

Had started seeing something along these lines with the bump to 0.17.2.

vvo pushed a commit to algolia/instantsearch that referenced this issue Nov 17, 2016
+ upgrade all deps
+ force yarn@0.16, see yarnpkg/yarn#1832

fixes #1577
vvo pushed a commit to algolia/instantsearch that referenced this issue Nov 17, 2016
+ upgrade all deps
+ force yarn@0.16, see yarnpkg/yarn#1832

fixes #1577
vvo pushed a commit to algolia/instantsearch that referenced this issue Nov 17, 2016
+ upgrade all deps
+ force yarn@0.16, see yarnpkg/yarn#1832

fixes #1577
vvo pushed a commit to algolia/instantsearch that referenced this issue Nov 17, 2016
+ upgrade all deps
+ force yarn@0.16, see yarnpkg/yarn#1832

fixes #1577
vvo added a commit to algolia/instantsearch that referenced this issue Nov 17, 2016
+ upgrade all deps
+ force yarn@0.16, see yarnpkg/yarn#1832

fixes #1577
@wyze
Copy link
Member

wyze commented Nov 18, 2016

I think it was #1663 that fixed this. Closing as it is resolved.

@wyze wyze closed this as completed Nov 18, 2016
@Danita
Copy link

Danita commented Nov 18, 2016

FYI It wasn't working for me right after upgrading yarn to v0.17.4, but this fixed it:

yarn cache clean
rm -rf node_modules
yarn install

@xzyfer
Copy link

xzyfer commented Nov 21, 2016

Still getting reports of this in 0.17.6 - sass/node-sass#1804 (comment)

@STRML
Copy link
Contributor

STRML commented Nov 21, 2016

karma-runner/karma-phantomjs-launcher#120 is related as well

@oyeanuj
Copy link

oyeanuj commented Nov 30, 2016

Same as @Danita. Was seeing it in 0.17.9, just doing yarn cache clean; yarn install didn't help until I removed the node_modules folder as well and tried again.

@STRML
Copy link
Contributor

STRML commented Dec 1, 2016

Possibly related: #2104

@MatthiasKuehneEllerhold
Copy link

MatthiasKuehneEllerhold commented Jan 17, 2017

Still happenening with yarn 0.19.1 :/ (Even after clearing the cache and deleting node_modules)

@intellix
Copy link

intellix commented Feb 2, 2017

0.20.0 fixed it for OSX, but still getting this on Linux with Codeship. The vendor folder just isn't there :(

@rutger1140
Copy link

@intellix Check sass/node-sass#1579 (comment)

ashleydb pushed a commit to ashleydb/ReactTodo that referenced this issue Mar 3, 2017
SCSS wasn't the issue... seems to be a yarn buiding issue on Heroku:
sass/node-sass#1579
yarnpkg/yarn#1832
@tiendq
Copy link

tiendq commented Mar 30, 2017

Still not fixed with 0.21.3 on macOS 10.12 :(

@xiaoyu2er
Copy link

// package.json
"scripts": {
    "update": "yarn install && npm rebuild node-sass"
  },

😢

@bestander
Copy link
Member

For those who still have this issue please open a new one with steps to reproduce and cc me

@tiendq
Copy link

tiendq commented Apr 21, 2017

FYI, I no longer see this issue with yarn 22 and now 23 on macOS. Including fresh install for new project.

@elimcjah
Copy link

@kittens has taken notice to the issue and with issue #3224 hopefully we have a fix in the near future.

@virgofx
Copy link

virgofx commented May 7, 2017

How to reproduce consistently:

CircleCI 2.0 Docker program.

  1. Create your project as is with a package.json. Create yarn lock file via yarn install/upgrade.
  2. Add node-sass or gulp-sass into project (Currently testing with gulp-sass)
  3. Ensure proper tokens are hooked into repository to allow webhooks for CircleCI
  4. Ensure project is configured to use CircleCI Beta 2.0 (Apply on their website)
  5. Add the following into .circleci/config.yml.
  6. Check in code.

The first run, the docker container will be built, no cache will exist, yarn will run an install, and then perform a successful compilation of sass using gulp-sass. It will succeed.

Do another noop checkin. The following build will use the cache saved from the previous successful run, restore the cache, and then run a yarn install which will be very quick because cache has been restored. The next compilation command (the SASS/SCSS), will now consistently fail with:

yarn run css
yarn run v0.23.4
$ gulp css
fs.js:914
  return binding.readdir(pathModule._makeLong(path), options.encoding);
                 ^

Error: ENOENT: no such file or directory, scandir '/root/project/node_modules/node-sass/vendor'

./.circleci/config.yml

version: 2
jobs:
  build:
    working_directory: ~/project
    
    docker:
      - image: node:7.10

    steps:
      - checkout
      - restore_cache:
          key: deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
      - run:
          command: yarn install --pure-lockfile --no-progress
      - save_cache:
          key: deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
          paths:
            - node_modules
# ADD THIS COMMAND HERE THAT USES NODE-SASS / GULP-SASS
#      - run:
#          command: yarn run css  

Refs:

@bestander
Copy link
Member

Commenting on old closed issue won't help, please create a new one if you have repro steps with latest yarn

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

No branches or pull requests