Webpacker: Railtie yarn check --integrity fails on development

Created on 23 Mar 2018  ·  58Comments  ·  Source: rails/webpacker

just updated to 3.4.0 and I get this:

========================================
  Your Yarn packages are out of date!
  Please run `yarn install` to update.
========================================


To disable this check, please add `config.webpacker.check_yarn_integrity = false`
to your Rails development config file (config/environments/development.rb).


yarn check v1.5.1
warning package.json: No license field
warning No license field
warning Integrity check: Flags don't match
error Integrity check failed
error An unexpected error occurred: "Found 1 errors.".
info If you think this is a bug, please open a bug report with the information provided in "/Users/markus/svn/caseman-events/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.

If I run it manually, everything is fine:

→   yarn check --integrity                                                                                                                                                                       [demo/develop]
yarn check v1.5.1
warning package.json: No license field
warning No license field
success Folder in sync.
   Done in 0.10s.

If I use NODE_ENV=production I can reproduce it:

→   NODE_ENV=production yarn check --integrity                                                                                                                                                   [demo/develop]
yarn check v1.5.1
warning package.json: No license field
warning No license field
warning Integrity check: Flags don't match
error Integrity check failed
error An unexpected error occurred: "Found 1 errors.".
info If you think this is a bug, please open a bug report with the information provided in "/Users/markus/svn/caseman-events/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.

If I install with production ...

NODE_ENV=production yarn install

... I can use rails again and the rails integrity check works. But of course I want to use my development yarn packages, so this is no solution.

The problems seems to be that yarn check --integrity is run with NODE_ENV=producion, even locally when developing.

Most helpful comment

For me restarting spring fixed it: spring stop

All 58 comments

@doits When is this happening -running binstubs or rake tasks?

It happened to me when trying to upgrade the binstubs

bundle exec rails webpacker:binstubs

This is happening to me on a fresh install:

created a new app (this step seemed to work fine):

rails new install_test --webpack

created databases:

rails db:create

then tried starting server

rails server

output:

=> Booting Puma
=> Rails 5.1.5 application starting in development
=> Run `rails server -h` for more startup options


========================================
  Your Yarn packages are out of date!
  Please run `yarn install` to update.
========================================


To disable this check, please add `config.webpacker.check_yarn_integrity = false`
to your Rails development config file (config/environments/development.rb).


yarn check v1.5.1
warning Integrity check: Flags don't match
error Integrity check failed
error An unexpected error occurred: "Found 1 errors.".
info If you think this is a bug, please open a bug report with the information provided in "/Users/kurt/Sites/install_test/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.


Exiting

yarn-error.log trace

Trace: 
  Error: Found 1 errors.
      at MessageError.Error (native)
      at new MessageError (/usr/local/Cellar/yarn/1.5.1/libexec/lib/cli.js:186:110)
      at /usr/local/Cellar/yarn/1.5.1/libexec/lib/cli.js:59470:13
      at next (native)
      at step (/usr/local/Cellar/yarn/1.5.1/libexec/lib/cli.js:98:30)
      at /usr/local/Cellar/yarn/1.5.1/libexec/lib/cli.js:109:13

I'm running into the same thing with a new Rails 5.2 RC2 app. For me it happened when running bundle exec active_storage:install, but it sounds like there is something behind the scenes that multiple things are hitting causing this issue.

Downgrading to 3.3.1 resolves the issue, FYI.

The same problem (rails webpacker:install). Downgrading to 3.3.1 resolved that.

Hey @joeybeninghove I had the same issue when trying to use Active Storage with Rails 5.2rc2. I've done as suggested downgrading webpacker to 3.3.1. However, I'm getting "Could not find rake-12.3.1 in any of the sources" when trying to run my rails console. Executing bundle install doesn't solve it.
Did it happen to you?

Thanks everyone, just made a PR

@guilleiguaran We added that production flag earlier on the yarn install task, which raises integrity error after running bundle exec rails assets:precompile in development. By default, yarn respects NODE_ENV so I am not sure if we should consider removing this flag or keep it to ensure deterministic behaviour.

It's a bit unintuitive though, consider this example:

screen shot 2018-03-24 at 13 58 05

First, when we ran assets:precompile it executed fine but then it installed deps with production flag (using rake yarn install task), which changed the integrity and when we ran rails server again it threw integrity error.

What do you think?

Just released 3.4.1 ^^

@gauravtiwari Nope. Did not help. It appears when I want to create a model:

rails g model TestModel

Output:

========================================
  Your Yarn packages are out of date!
  Please run `yarn install` to update.
========================================


To disable this check, please add `config.webpacker.check_yarn_integrity = false`
to your Rails development config file (config/environments/development.rb).


env: node: No such file or directory

@afuno Could you please run yarn just to make sure yarn is run in development mode and then create model?

BTW, this is still an issue: https://github.com/rails/webpacker/issues/1374#issuecomment-375891562
so if you do assets:precompile make sure to run yarn again to re-install deps.

I am facing the same issue. Can someone please suggest what am I doing wrong here!

Ruby 4.2.3
Rails 5.1.5
Webpacker 3.2.2
Hosted on: Elastic Beanstalk
yarn --version ~> 1.5.1
node --version ~> 6.13.1
RAILS_ENV ~> development

Output of /var/log/eb-commandprocessor.log

`/home/webapp` is not a directory.
Bundler will use `/tmp/bundler/home/webapp' as your home directory temporarily.
+ '[' false == true ']'
+ su -s /bin/bash -c 'bundle exec rake assets:precompile' webapp
`/home/webapp` is not a directory.
Bundler will use `/tmp/bundler/home/webapp' as your home directory temporarily.


========================================
  Your Yarn packages are out of date!
  Please run `yarn install` to update.
========================================


To disable this check, please add `config.webpacker.check_yarn_integrity = false`
to your Rails development config file (config/environments/development.rb).


yarn check v1.5.1
warning Skipping preferred cache folder "/home/webapp/.cache/yarn" because it is not writable.
warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-497".
error Couldn't find an integrity file
error An unexpected error occurred: "Found 1 errors.".
info If you think this is a bug, please open a bug report with the information provided in "/var/app/ondeck/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.

(Executor::NonZeroExitStatus)

[2018-03-26T12:37:38.806Z] ERROR [6562]  : Command CMD-SelfStartup failed!
[2018-03-26T12:37:38.806Z] INFO  [6562]  : Command processor returning results: 
{"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"(TRUNCATED)...nexpected error occurred: \"Found 1 errors.\".\ninfo If you think this is a bug, please open a bug report with the information provided in \"/var/app/ondeck/yarn-error.log\".\ninfo Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command. \nHook 
/opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh failed. For more detail, check 
/var/log/eb-activity.log using console or EB CLI","returncode":1,"events":[]}],"truncated":"true"}
[2018-03-26T12:37:38.807Z] ERROR [6562]  : exit (SystemExit)
at /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/beanstalk-core-2.11/bin/command-processor:48:in `exit'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/beanstalk-core-2.11/bin/command-processor:48:in `<top (required)>'
from /opt/elasticbeanstalk/lib/ruby/bin/command-processor:23:in `load'
from /opt/elasticbeanstalk/lib/ruby/bin/command-processor:23:in `<main>'

Output of /var/app/ondeck/yarn-error.log

Trace: 
  Error: Found 1 errors.
    at MessageError.Error (native)
    at new MessageError (/usr/share/yarn/lib/cli.js:186:110)
    at /usr/share/yarn/lib/cli.js:59470:13
    at next (native)
    at step (/usr/share/yarn/lib/cli.js:98:30)
    at /usr/share/yarn/lib/cli.js:109:13

@puneetpandey Have you run yarn install as suggested in the error? Does the error go away after that?

@gauravtiwari tried running yarn install manually from /var/app/ondeck and it ran successfully.

ondeck]$ yarn install
yarn install v1.5.1
[1/4] Resolving packages...
success Already up-to-date.
Done in 26.86s.

@puneetpandey Great 👍 everything is working now? You need to make sure NODE_ENV remains consistent. Also, don't use yarn install rake task in development since it installs deps in production mode by default, which causes integrity check to fail. Just use yarn or yarn install

@gauravtiwari NODE_ENV was missing from my environment variables. Now added that and set it to development. I am now running eb deploy again to see, if I encounter any issue/s. Will keep posting here. Thanks for the help!

~@gauravtiwari how can NODE_ENV be consistent if I'm running yarn install in dev but then (on CI or in production) yarn check --integrity is run in production and I get Flags don't match~
nvm, just realized this feature is not meant to be enabled in test and production envs

Same problem here using docker.

Starting myapp_db_1 ... done
Creating myapp_web_1 ... done
Attaching to gymintel_db_1, gymintel_web_1
db_1   | 2018-07-08 03:55:23.713 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db_1   | 2018-07-08 03:55:23.713 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db_1   | 2018-07-08 03:55:23.719 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1   | 2018-07-08 03:55:23.894 UTC [22] LOG:  database system was interrupted; last known up at 2018-07-08 03:27:33 UTC
db_1   | 2018-07-08 03:55:27.237 UTC [22] LOG:  database system was not properly shut down; automatic recovery in progress
db_1   | 2018-07-08 03:55:27.306 UTC [22] LOG:  invalid record length at 0/1633A70: wanted 24, got 0
db_1   | 2018-07-08 03:55:27.306 UTC [22] LOG:  redo is not required
db_1   | 2018-07-08 03:55:27.548 UTC [1] LOG:  database system is ready to accept connections
web_1  | => Booting Puma
web_1  | => Rails 5.2.0 application starting in development
web_1  | => Run `rails server -h` for more startup options
web_1  |
web_1  |
web_1  | ========================================
web_1  |   Your Yarn packages are out of date!
web_1  |   Please run `yarn install` to update.
web_1  | ========================================
web_1  |
web_1  |
web_1  | To disable this check, please add `config.webpacker.check_yarn_integrity = false`
web_1  | to your Rails development config file (config/environments/development.rb).
web_1  |
web_1  |
web_1  | yarn check v1.7.0
web_1  | error Couldn't find an integrity file
web_1  | error Found 1 errors.
web_1  | info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.
web_1  |
web_1  |
web_1  | Exiting
myapp_web_1 exited with code 1

My dockerfile:

FROM ruby:2.5.1
ADD https://dl.yarnpkg.com/debian/pubkey.gpg /tmp/yarn-pubkey.gpg
RUN apt-key add /tmp/yarn-pubkey.gpg && rm /tmp/yarn-pubkey.gpg
RUN echo 'deb http://dl.yarnpkg.com/debian/ stable main' > /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -qq -y --no-install-recommends build-essential libpq-dev curl
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt-get update && apt-get install -qq -y --no-install-recommends nodejs yarn
RUN mkdir /myapp
WORKDIR /myapp
COPY Gemfile /myapp/Gemfile
COPY Gemfile.lock /myapp/Gemfile.lock
RUN bundle install
RUN yarn install
COPY . /myapp

Getting the same issue. Followed these upgrade instructions -https://github.com/rails/webpacker#upgrading

$ node --version
v8.11.3

$ yarn --version
1.7.0

$ yarn install
yarn install v1.7.0
[1/4] 🔍  Resolving packages...
success Already up-to-date.
✨  Done in 0.54s.

$ yarn check --integrity
yarn check v1.7.0
success Folder in sync.
✨  Done in 0.10s.

$ rails --version
Rails 5.2.0

$ ruby --version
ruby 2.5.1p57

Issue:

$ rails c

========================================
  Your Yarn packages are out of date!
  Please run `yarn install` to update.
========================================


To disable this check, please add `config.webpacker.check_yarn_integrity = false`
to your Rails development config file (config/environments/development.rb).


yarn check v1.7.0
warning Integrity check: System parameters don't match
error Integrity check failed
error Found 1 errors.
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.

Just dropping a note here to share my experience.

I've encountered the exact same issue.
For my case, just restarting my terminal fixed the problem.

I had changed few configuration for NVM, which would have done something related.

couple of things about docker installation, which sort of works. try

  • to run yarn install after copying your folder. yarn needs a few files in your app to run
  • make sure nodejs is a newer copy. default node installations do not have npm. you can use :
    > RUN curl -sL https://deb.nodesource.com/setup_11.x | bash
    > RUN apt-get install -qq -y nodejs
  • installing yarn using npm:
    > RUN npm install -g yarn

Why was this issue closed? What is the solution? What's happening that causes this?

Why was this issue closed? What is the solution? What's happening that causes this?

@kulte I found that running sudo yarn install works.
Thanks to: https://stackoverflow.com/questions/50078826/rubymine-and-yarn

Running sudo yarn install also didn t work. It was giving the same error.

After disabling the yarn integrity check (config.webpacker.check_yarn_integrity = false) it worked. But I don t think this is the proper solution.

Same thing - rails 5.1 with ruby 2.5.3 ... nvm installs vuejs fine, yarn seems to work till I go to start server up.

Sudo install yarn doesn't work.

Closing / reopening terminal as well as shutting down complete - no fix.

yarn --verify-tree was more helpful ...

mirv:~/workspace $ yarn --verify-tree
yarn install v1.13.0
[1/4] Resolving packages...
[2/4] Fetching packages...
error @rails/[email protected]: The engine "node" is incompatible with this module. Expected version ">=6.14.4". Got "6.11.2"
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Did anyone find a fix for this?
I am facing the same issue with JRuby-9.2.6.0 / Rails-5.0.7.2

config.webpacker.check_yarn_integrity = false

Seems to work but doesn't look like a good solution

  * 2019-03-16 08:13:12 executing `deploy:assets:precompile'
  * executing "cd /data/recruiters/releases/20190316024255 && RAILS_ENV=staging_internal bundle exec rake assets:precompile"
    servers: ["192.168.1.206"]
    [192.168.1.206] executing command
 ** [out :: 192.168.1.206] jruby: warning: unknown property jruby.cext.enabled
 ** [out :: 192.168.1.206] Loading Vger
 ** [out :: 192.168.1.206] Adding at_exit handler to close RabbitMQ Connection
 ** [out :: 192.168.1.206] Subscribing to RabbitMQ Queues
 ** [out :: 192.168.1.206] Loading Her Configuration
 ** [out :: 192.168.1.206] 
 ** [out :: 192.168.1.206] 
 ** [out :: 192.168.1.206] ========================================
 ** [out :: 192.168.1.206] Your Yarn packages are out of date!
 ** [out :: 192.168.1.206] Please run `yarn install` to update.
 ** [out :: 192.168.1.206] ========================================
 ** [out :: 192.168.1.206] 
 ** [out :: 192.168.1.206] 
 ** [out :: 192.168.1.206] To disable this check, please add `config.webpacker.check_yarn_integrity = false`
 ** [out :: 192.168.1.206] to your Rails development config file (config/environments/development.rb).
 ** [out :: 192.168.1.206] 
 ** [out :: 192.168.1.206] 
 ** [out :: 192.168.1.206] yarn check v1.13.0
 ** [out :: 192.168.1.206] warning package.json: No license field
 ** [out :: 192.168.1.206] warning No license field
 ** [out :: 192.168.1.206] error Couldn't find an integrity file
 ** [out :: 192.168.1.206] error Found 1 errors.
 ** [out :: 192.168.1.206] info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.

For me restarting spring fixed it: spring stop

For me restarting spring fixed it: spring stop

@pawurb's solution works for me!

I encountered this when upgrading to v4.

None of the above solutions worked for me.

It turned out that even though I had disabled the integrity check in config/webpacker.yml, this was getting overridden by the earlier style of config in config/environments/development.rb

Seems that the canonical location for this config got moved from development.rb to webpacker.yml, but that older installations of Webpacker might still have the old config.

Removing the following two lines did the trick for me.

--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -1,6 +1,4 @@
 Rails.application.configure do
-  # Verifies that versions and hashed value of the package contents in the project's package.json
-  config.webpacker.check_yarn_integrity = true
   # Settings specified here will take precedence over those in config/application.rb.

   # In the development environment your application's code is reloaded on

For me restarting spring fixed it: spring stop

This works for me

"spring stop" worked for me too! Thanks!

For me it was:

rm -rf node_modules

[ONLY for people using nvm lazy loading]

Be sure to run $ node -v to trigger nvm to load before trying other solution.

P.s. For me, forgetting to load nvm always results in this error, but sometimes even with nvm loaded the problem persists, that's when I'll do $ spring stop (proposed by @pawurb).

Screen Shot 2019-06-30 at 2 27 49 PM

Left: Failed because node is actually not available (I am using NVM_LAZY_LOAD=true from zsh-nvm)

Right: Ensured node is available first and fixed.

i have solve

config/webpacker.yml

-  check_yarn_integrity: true
+  check_yarn_integrity: false

I had this issue, but my real problem was node-sass failing to install connected to incompatability with nodejs 12. I removed node and installed node 10.12 and the problem was solved.

I followed the @mirageglobe 's suggestion that using npm install -g yarn fixed my project.

@schmijos that you so much for that. I encountered this issue after upgrading webpacker (4.0.2 -> 4.0.7) and I started encountering the issue. Only deleting folder helped to resolve the issue.

I followed the @mirageglobe 's suggestion that using npm install -g yarn fixed my project.

This also worked for me. I previously had yarn version 1.7.0. Running npm install -g yarn upgrade yarn to version 1.17.3. After re-installing the packages with the new yarn version the issue went away.

Thanks!

spring stop or DISABLE_SPRING=1 rails c were the only solutions that worked for me (and it seems like several others). Why doesn't spring play nicely with yarn here? Anybody have an idea what's going on?

Try just yarn install

Docker

I kept running into this issue while in Docker. The problem was that I was precompiling my app after I copied the entire app in. I.e., my Dockerfile contained the following:

# Copy the Gemfile as well as the Gemfile.lock and install
# the RubyGems. This is a separate step so the dependencies
# will be cached unless changes to one of those two files
# are made.
COPY Gemfile Gemfile.lock package.json yarn.lock ./
RUN bundle install --verbose --jobs 20 --retry 5 && \
    yarn install --check-files

# Copy the main application.
COPY . ./

# precompile assets
RUN bundle exec rake assets:precompile

This essentially overwrote the dependencies yarn installed in Docker with the ones on my local computer, and hence the errors.

Solution

Add the node_modules/ folder in your .dockerignore file:


You're welcome.

For me restarting spring fixed it: spring stop

It gets the job done, but the issue keeps reappearing again and again anyway

just updated to 3.4.0 and I get this:

========================================
  Your Yarn packages are out of date!
  Please run `yarn install` to update.
========================================


To disable this check, please add `config.webpacker.check_yarn_integrity = false`
to your Rails development config file (config/environments/development.rb).


yarn check v1.5.1
warning package.json: No license field
warning No license field
warning Integrity check: Flags don't match
error Integrity check failed
error An unexpected error occurred: "Found 1 errors.".
info If you think this is a bug, please open a bug report with the information provided in "/Users/markus/svn/caseman-events/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.

If I run it manually, everything is fine:

→   yarn check --integrity                                                                                                                                                                       [demo/develop]
yarn check v1.5.1
warning package.json: No license field
warning No license field
success Folder in sync.
   Done in 0.10s.

If I use NODE_ENV=production I can reproduce it:

→   NODE_ENV=production yarn check --integrity                                                                                                                                                   [demo/develop]
yarn check v1.5.1
warning package.json: No license field
warning No license field
warning Integrity check: Flags don't match
error Integrity check failed
error An unexpected error occurred: "Found 1 errors.".
info If you think this is a bug, please open a bug report with the information provided in "/Users/markus/svn/caseman-events/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.

If I install with production ...

NODE_ENV=production yarn install

... I can use rails again and the rails integrity check works. But of course I want to use my development yarn packages, so this is no solution.

The problems seems to be that yarn check --integrity is run with NODE_ENV=producion, even locally when developing.

I had a yarn.lock file in the root directory of my rails app. Deleting that solved my issue!

Deleting yarn.lock also fix the issue in my rails 6.0 project .... had issue after upgraded system node from 10 to 12 -v

Update: Unfortunately deleting yarn.lock didnt fix the issue in total the message disappears but also I lost the sass on my site (styling was of because some js error). So I reverted the version of node in nvm from 12.0.0 to 10.xx and it worked okay.

rm yarn.lock && sudo yarn install solved the problem for me

I am running into the exact same issue too. I can't get around it using docker. I did update my webpacker.yml config setting check_yarn_integrity: false but I don't like that solution.

Suggestions? Ideas?

I have a .dockerignore file ignoring these:

  • .dockerignore
  • Dockerfile
  • node_modules

Here is my Dockerfile

FROM ruby:2.6.5-alpine

RUN apk update && apk add --no-cache \
    bash \
    build-base \
    nodejs \
    yarn \
    sqlite-dev \
    tzdata

# throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config --global frozen 1

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

COPY package.json /usr/src/app/package.json
COPY yarn.lock /usr/src/app/yarn.lock
RUN yarn install --check-files

RUN gem install bundler
COPY Gemfile Gemfile.lock /usr/src/app/
RUN bundle install --binstubs

COPY ./entrypoint.sh /usr/src/app/entrypoint.sh
RUN chmod +x /usr/src/app/entrypoint.sh

COPY . /usr/src/app

CMD ["/usr/src/app/entrypoint.sh"]

Got the same thing with a fresh Docker build.

Dockerfile

FROM ruby:2.6.5-alpine

RUN apk add --no-cache \
      nodejs \
      build-base \
      postgresql-dev \
      tzdata \
      yarn

docker-compose.yml

command: 'sh -c "bin/rails db:create db:migrate && bin/rails server --port 3001 --binding 0.0.0.0"'

Adding yarn install to the command reolved it, but this is definitely not nice:

command: 'sh -c "yarn install && bin/rails db:create db:migrate && bin/rails server --port 3001 --binding 0.0.0.0"'

For me restarting spring fixed it: spring stop

Thank you very much. You help me too much. AH. My mac was almost broken by me. You saved it.

For anyone using nvm to manage Node versions, make sure you're on the correct Node version before installing. This may apply to Docker as well if your image defaults a different version of Node than you used to install things originally.

  1. nvm use to use the version defined in .nvmrc
  2. yarn install --check-files with the correct Node version
  3. nvm use in any other shell you want to run commands in
  4. Now the integrity checks will pass

@gauravtiwari Nope. Did not help. It appears when I want to create a model:

rails g model TestModel

Output:

========================================
  Your Yarn packages are out of date!
  Please run `yarn install` to update.
========================================


To disable this check, please add `config.webpacker.check_yarn_integrity = false`
to your Rails development config file (config/environments/development.rb).


env: node: No such file or directory

This is what worked for me. I was "dockering" a rails 6 app

I use nvm, so first time(after the boot) i cd'ed to project and tried to run rails s - its failed with same error, after switch to proper node nvm use 8.0.0I had to do spring stop -
Thenrails s worked under environment of 8.0.0

If you can, use node 10 or 12. Node 8 is End of Life:
image

its failed with same error, after switch to proper node nvm use 8.0.0

If you do need to use 8, make sure you set the default and at least use the latest version by excluding those explicit zeros. eg:

nvm install 8
nvm alias default 8
nvm use 8

That could even address other comments in this issue: https://stackoverflow.com/a/24587177/6091685

The deal is that _many_ things need to be in sync on the same node.js version. They can be out of sync when you have a default node version, create a Rails project, and then switch to a different version, for example, via nvm use. I didn't check every permutation, but node version can affect:

  • Rails' spring preloader. spring stop
  • node_modules rm -rf node_modules
  • yarn.lock rm yarn.lock
  • Rails server. Ctrl-C rails s

yarn install --check-files 🤞

yarn --update-checksums worked for me!

spring stop worked here as well

I'm using nvm to control the version of node for projects, my projects don't have spring.

I try a lot of solution above, for examples:

yarn --update-checksums
yarn install --check-files
yarn install
rm -rf node_module && yarn install

But it __doesn't work__

This is how I solved the problem:

rm -rf yarn.lock
yarn install

Why was this issue closed? What is the solution? What's happening that causes this?

@kulte I found that running sudo yarn install works.
Thanks to: https://stackoverflow.com/questions/50078826/rubymine-and-yarn

Update on my issue. I had installed yarn first from apt-get, and then installed nvm. This resulted in webpacker not using the nvm version. sudo yarn install did work, but I had to run it basically every time I changed project or ran tests etc. Uninstalling yarn and keeping nvm solved this for me entirely. Hope this helps some people :)

please check webpacker.yml i have found that i wrote check_yarn_integrity twice and one of the was true after removing that the issue get fixed

I have the same issue and I solved this by uninstalling yarn 2 and reverting back to yarn 1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

suhomlineugene picture suhomlineugene  ·  3Comments

vtno picture vtno  ·  3Comments

ijdickinson picture ijdickinson  ·  3Comments

itay-grudev picture itay-grudev  ·  3Comments

amandapouget picture amandapouget  ·  3Comments