I was following the steps provided as on the web http://yeoman.io/. After doing with all the steps, i am facing this error message
`$ grunt
Loading "Gruntfile.js" tasks...ERROR
Error: Cannot find module 'connect-livereload'
Warning: Task "default" not found. Use --force to continue`
In my package.json, i have all my dependency packages
"connect-livereload": "~0.2.0",
"grunt-google-cdn": "~0.2.0",
"grunt-ngmin": "~0.0.2",
"grunt-contrib-livereload": "~0.1.2"
I've got the same issue. Fixed it this way:
npm install --save-dev connect-livereload
npm install
May be "npm install" is enough.
install
npm install connect-livereload --save-dev
Related
When installing Tailwind-CSS, I ran this command
yarn add tailwindcss#npm:#tailwindcss/postcss7-compat postcss#^7 autoprefixer#^9
I got this error message, which tells me to update node to a compatible version.
**error** tailwindcss#2.1.2: The engine "node" is incompatible with this module. Expected version ">=12.13.0". Got "10.24.1"
So how do I update node properly?
I am using Ruby on Rails 6
Update
When I updated node, I ran into a subsequent problem. This is what I ran to update node
nvm install 12.22.1
Now when I try to install Tailwind-CSS, I get a different error message.
Command 'yarn' not found
So then I ran nvm use 10.24.1 and I am back to square one.
When you install via yarn, append
--ignore-engines
So the full installation command is
yarn add tailwindcss#npm:#tailwindcss/postcss7-compat postcss#^7 autoprefixer#^9 --ignore-engines
I don't know why this works, but it does
I'm trying to make a new project with Ruby on Rails and I'm installing all the required gems. Everything looks right but when I run foreman start I get a list of errors
I tried reinstalling the gems and updating them but I always get this.
Thanks for the help!
Probably, webpack cannot be found.
Try to run:
npm install or yarn install
bundle install
bundle exec rake webpacker:install
I've been developing an app using Webpack, Vue.js and Rails. No problems for two months, but out of nowhere when I try to start rails console rails c, yarn complains that packages out of date:
error An unexpected error occurred: "Unknown language key integrityNodeDoesntMatch".
info If you think this is a bug, please open a bug report with the information provided in "/Users/maksimfedotov/vras/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.
========================================
Your Yarn packages are out of date!
Please run `yarn install` to update.
========================================
Yet when I run yarn install:
yarn install v1.3.2
[1/4] 🔍 Resolving packages...
success Already up-to-date.
✨ Done in 0.71s.
I've been looking through yarn and webpacker documentation, tried various yarn cleanup commands, but no luck.
Interestingly enough, I can still run the server, its only console that complains.
This is an old issue, which has been resolved, so I am writing down what I did in the end:
Simply deleting node_modules usually solves the issue. If you are using spring, it also can mess this up, so consider running DISABLE_SPRING=1 rails s to see if that helps
Try restarting spring by running spring stop.
This fixed the issue for me, and meant I didn't need to constantly prefix commands with the spring disable flag.
The above command stops spring: to check that it automatically restarted, run spring status.
Credit to this comment on GitHub for the solution!
You can add in the config/environments/development.rb
this configuration setting
config.webpacker.check_yarn_integrity = false
It also it forget to check yarn integrity on every rails call, as migrations, launching consoles ..., in development environment
This problem resurfaced in April 2021 due to compatibility issues between node-sass and node version 16. (I had similar problems here and provide a similar answer to that below here).
So my solution is to downgrade node until version 16 is fully compatible.
Install node 14 with nvm install 14, then set it to the global default with nvm alias default 14.
Then:
Stop your rails server if it's running
Open a fresh new terminal window (so that node --version returns 14.x (not 16)
Run spring stop
Delete yarn.lock
Remove existing node modules with rm -rf node_modules
Check that node --version returns 14. If it doesn't run nvm install 14 again.
Now reinstall modules with yarn install (if you don't have yarn for node 14, install it with npm install --global yarn)
It should succeed!
Restart your rails server, and it will work!
Other useful info:
This github issue - this comment in particular
Try just yarn install then rails c again
If you are switching branches which change yarn.lock and just want to run a rails console without having to keep running yarn install everytime you switch, you can add this to your app/config/development.rb
config.webpacker.check_yarn_integrity = ENV['SKIP_YARN'].nil?
Then when rails complains you can simply do this
SKIP_YARN=true rails c
In my case, this solve the problem.
rm -rf yarn.lock
yarn install
Try this: NODE_ENV=development yarn install
For those familiar with the react-on-rails gem, or more generally, yarn:
Just today I updated my Node version to 8.8.1 via Homebrew. Now, when I attempt to run bundle && yarn && foreman start -f Procfile.dev (or just yarn install), I get the following message:
error react-webpack-rails-tutorial#0.0.1: The engine "node" is
incompatible with this module. Expected version "5.10.0".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation
about this command.
This is likely a very simple issue I am running into, but I have been unable to fix it after a few hours of debugging.
I tried manually updating my Node version in package.json to be that on my computer (did not seem to take effect whatsoever), downgrading my version to 5.10.0 via Homebrew (but was unable to), and even upgrading to the latest version of the gem which meant installing webpack as well.
No matter what I did, my local server startup (bundle && yarn && foreman start -f Procfile.dev) still lead to the same error above. Any ideas for this poor soul?
For anyone running into this same issue, I have not found a solution for the underlying issue but I have found a temporary workaround.
Simply run
bundle && yarn --ignore-engines && foreman start -f Procfile.dev
instead of
bundle && yarn && foreman start -f Procfile.dev
I hope this helps someone else that may have found themselves stuck in the same situation!
You need to update your Node.js version. Try to
Clear NPM's cache:
sudo npm cache clean -f
Install a little helper called 'n'
sudo npm install -g n
Install latest stable Node.js version
sudo n stable
I give you this list of checks to do from the react-webpack-rails-tutorial github page
Basic Demo Setup
Be sure that you have Node installed! We suggest nvm, with node version v6.0 or above. See this article Updating and using nvm.
git clone git#github.com:shakacode/react-webpack-rails-tutorial.git
cd react-webpack-rails-tutorial
Check that you have Ruby 2.3.0 or greater
Check that you're using the right version of node. Run nvm list to check. Use 5.5 or greater.
Check that you have Postgres installed. Run which postgres to check.
Use 9.4 or greater.
Check that you have qmake installed. Run which qmake to check. If
missing, follow these instructions: Installing Qt and compiling
capybara-webkit
Check that you have Redis installed. Run which redis-server to
check. If missing, install with Homebrew (brew install redis) or
follow these instructions.
bundle install
brew install yarn
yarn
rake db:setup
foreman start -f Procfile.hot
Open a browser tab to http://localhost:3000 for the Rails app
example with HOT RELOADING
Try Hot Reloading steps below!
foreman start -f Procfile.static
Open a browser tab to http://localhost:3000 for the Rails app
example.
When you make changes, you have to refresh the browser page.
I'm having this issue on ubuntu 14.04LTS:
When I do rake bower:install:dev I get:
Error: EACCES, permission denied
'home/MyName/.config/configstore/bower-github.yml' You don't have access to this
file.
When I do sudo rake bower:install:dev I get:
bower ESUDO Cannot be run with sudo
Additional error details: Since bower is a user command, there is no
need to execute it with superuser permissions. If you're having
permission errors when using bower without sudo, please spend a few
minutes learning more about how your system should work and make any
necessary repairs.
http://www.joyent.com/blog/installing-node-and-npm
https://gist.github.com/isaacs/579814
You can however run a command with sudo using --allow-root option
When I do sudo rake bower:install:dev --allow-root I get:
invalid option: --allow-root
How do I solve this issue?
I solved it by adding .bowerrc file in the root of my app with the following content:
{ "allow_root": true }