The problem
grunt server outputs this:
Warning: Task "compass:server" not found.
I uploaded Gruntfile.js here: https://gist.github.com/ComFreek/7289648
That's the default file I got after creating a new Yeoman project.
Details
I am reading Building Web Apps With Yeoman And Polymer and following the described console commands to run.
My system:
Windows 8.1 Pro 64-bit
NodeJS 0.10.21
NPM 1.3.11
I've already executed these commands:
npm install -g yo
npm install generator-polymer -g
yo polymer
grunt server told me that I had to install Ruby and Compass.
I installed Ruby from here:
http://rubyinstaller.org/
After installing, I also successfully whether Ruby has really been registered in the PATH.
I used NPM for installing Compass:
npm install grunt-contrib-compass --save-dev -g
(I tried a local and global install of Compass. Neither of them worked.)
This is the exact output of grunt:
D:\test>grunt server
Running "server" task
Warning: Task "compass:server" not found. Use --force to continue.
Aborted due to warnings.
Elapsed time
server 4ms
Total 4ms
It works now...
Unfortunately, I still don't know the exact cause. I went through all of my instructions above again, and it just worked out of the box.
In any case, I recommend updating all packages. My version numbers are (last edited: 02.02.14):
[NodeJS v.0.10.24]
[NPM 1.3.21]
[grunt-cli v0.1.11]
[grunt v0.4.2]
I had the same problem but it was fixed after I've installed Ruby's compass:
# gem install compass
Hint: gem is the package manager for Ruby, so Ruby should be existing in the system.
For Redhat's based linux systems, you can use the following to install Ruby and gem:
# yum install gcc ruby-devel rubygems
# gem install compass
For Debian's based linux systems, you can check this
Install compass with the following command:
npm install -g compass
If you've installed node as a sudo user (which is not recommendable), you should add sudo to the command (and next time use NVM)
sudo npm install -g compass
Install Ruby, add to env -> path variable, add to pathtext as per link below
http://www.tutorialspoint.com/ruby/ruby_installation_windows.htm
Then install compass in ruby.
Only this solved the issue
The only thing that worked for me was:
npm install ruby-compass.
I had previously installed compass like Paul said but didn't work.
Related
I need some help and clarification regarding Yarn installation process.
MacOS ver. 10.14.2
I've installed Homebrew via official site (ver. 2.0.1).
I've installed NPM by downloading package from official site (ver. 10.15.1 LTS).
Now when I tried to install yarn via brew install yarn
I have the following error:
The post-install step did not complete successfully
You can try again using `brew postinstall node`
As I undertand, NPM installs node locally, when, for instance, I try to use create-react-app. When I use Homebrew to install yarn, it tries to install node globally. And we have conflict here.
I've found suggestion to use:
sudo chown -R `whoami`:admin /usr/local/
I am not entirely sure what this command does.
So, the questions are:
Why changing the owner of the folder should be a solution? How will it affect multi user system?
What is the correct way to install yarn?
Can be there any conflicts if node is installed globally and locally (app folder.)
P.S. Please correct me, if I have wrong understanding here.
As Trott points out, npm does not install Node. npm is a package manager that comes bundled with Node. If you install Node, you automatically install npm.
Why changing the owner of the folder should be a solution? How will it affect multi user system?
It's not. Changing the permissions of this folder is sometimes suggested as a workaround for when you have npm installed in a location owned by root. This can cause EACCES errors when you try to install packages globally.
What is the correct way to install yarn?
While you can install Yarn through the Homebrew package manager, I would recommend doing: npm install -g yarn.
Can be there any conflicts if node is installed globally and locally (app folder).
You can't install Node globally and locally. You can install multiple versions of Node on the same machine, however.
I'm not a big fan of having one global Node installation, as it makes it a pain to update (esp. if one application relies on an older version of Node) and, depending on how you install Node, it can lead to permissions errors.
The better way is to use a version manager. This will allow you to install multiple Node versions on your machine, avoid permissions errors and swap between these Node versions at will.
I would recommend using nvm. It works nicely on MacOS. The TL;DR for installing nvm is:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
But I would encourage you to look at the project on GitHub and read its README. There is also a good tutorial on how to use it here.
Once you have Node installed using nvm, run npm install -g yarn to install Yarn globally and you should be off to the races.
Finally, you might want to read this tutorial on using npm, as it could help to clear up some of the concepts.
HTH
I have faced a problem after install yarn by running npm install -g yarn command in my OS Windows 10 Pro. That was showing yarn' is not recognized as an internal or external command operable program or batch file.
Whatever, I have found the solution:
After npm,
go to CMD from your windows PC,
write : *npm install -g yarn*
then,
Go to Environmental Variables set up.
Edit Path and add new and paste:
C:\Users\User\AppData\Roaming\npm\node_modules\yarn\bin\
Restart your terminal. And then check again in your cmd by running :
*yarn* or *yarn --version*
I have been trying to install and run my first hyperledger fabric application (http://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html) but have been encountering the following issue everytime I run the "npm install" command.
Please let me know what is the solution to resolve this issue.
The error is as follows:
I have tried deleted .node-gyp, .npmrc folder from $HOME and restarting the computer.Nothing helped.
Faced a similar issue in Centos 7 and resolved by installing the development tools..
To compile and install native addons from npm you need to install the development tools.
Running the following commands will resolve your issue;
sudo apt install gcc g++ make
npm install
node-gyp has dependency on ms visual basic redistributable. You have to check that relation and install. Hope you have done that.
Change the python version to 2.7. Then run
npm install -g --production windows-build-tools
as administrator.
I have recently started working with Angular 2 and am unable to get the Angular 2 Quickstart project to run correctly due to a number of errors in my npm dependencies.
Am I able to globally uninstall everything that was previously installed with npm to allow me to do a clean install of it and any required dependencies?
Note: The errors are the same as these examples which are caused by packages needing to be installed globally, however, the errors still occur having followed these steps...
To check your global installed packages you can type:
npm ls -g --depth=0
That lists all global installed packages with depth=0. That mean that it doesn't output dependencies of the packages. You can uninstall global packages with:
npm uninstall -g package-name
Please do not uninstall the npm package itself... But you can update your npm version with npm:
npm install npm -g
As mentioned in the Article your Node.js version should be at least v4.x.x and the npm version should be v3.x.x. You can get the installed versions with these commands:
node -v
npm -v
Updating your Node.js depends on your Operating System. Assuming that you use Windows you should uninstall the current version via control panel and download an actual release from the official Node.js page. https://nodejs.org/en/download/current/
To get a great overview how npm works you should consider reading their
documentation: https://docs.npmjs.com/
Make sure you have the correct node.js version. The guide says 5.0 or greater but points you to the wrong download link.
Try this: https://nodejs.org/en/download/current/
With this node you should be able to follow the guide step by step.
When running grunt build and grunt serve the following warning is coming :
Warning: You need to have Ruby and Compass installed and in your system PATH for this task to work.
Use --force to continue.
Aborted due to warnings.
grunt version:
grunt-cli v0.1.13
grunt v0.4.5
Operating System:
Windows 7
How to resolve this warning ? Is Ruby and Compass are required or without these I can proceed ?
It depends on your Gruntfile, probably you have to install ruby and compass to execute your tasks.
To install ruby in Windows you need to download the installer in RubyInstaller for Windows. Do not forget to open the installer as a administrator.
Then, to install compass you need sass and compass. Try it:
gem install sass
gem install compass
It should be fix your problem.
Try to install the follwing packages with NPM
npm install grunt-contrib-sass ruby grunt-sass sass -g
If this doesn't work try installing Ruby on your environment.
searched, and did not see this specific problem.
Trying to get a MEAN stack built on my Linux Mint machine, and bumping into a bit of an unusual issue.
Got MongoDB installed, and finally got it running correctly (none of the instructions ANYWHERE mentioned having to create the /data/db/ directory and set permissions, go figure).... it works now.
Got NodeJS installed, and it appears to work correctly.
I had been told (apparently incorrectly) that NPM installs right alongside Node, with:
sudo apt-get install nodejs
but:
$ npm
bash: /usr/bin/npm: No such file or directory
So I go ahead and install NPM separately.
$ sudo apt-get install npm
Seems to work, so far, no errors, and it looks like it is pulling down the NPM package and installing it...
$ nodejs -v
v0.10.21
$ npm -v
$
?? It simply fails to respond without any error... so I try:
$ npm install grunt -g --save-dev
$
Same completely silent failure... in fact, NOTHING I could do gets a response out of NPM.
Looked all over the web, and saw nothing similar anywhere... found out that NPM holds its cache files in ~/.npm and noticed that this folder didn't exist (kinda like the mongo issue above), so I created it, and set permissions to 7777... still nothing.
Purged and re-installed both node and npm, tried installing them both together and separately (yes, desperation)... still no love.
WTF am I doing wrong?
I would love, eventually, to have a nice development environment setup, hopefully with Cloud9 as a local IDE.... but already pulling my hair out.
=========================================================================================
OK, after a few more headaches, this is up and built now... thank you all.
Would love to mark both as answers, but it won't let me.
npm does come with node. Where is apt-get pulling it from? I install the Mac OS X packages on my Mac for development and npm does in fact come with it. I compile from source on my CentOS server and npm comes with it.
Your package provider may be providing them separately as a (in)convenience to you.
As for why your npm command does not work after installation, I can't say for sure, but I am suspicious of your use of --save-dev and -g together.
-g means to install globally, which means 2 things:
It will be installed outside of your npm package's structure into a system location like /usr/bin or /usr/local/bin
It requires root access to install. Did you use sudo to run it with root access?
Both of those requirements conflict with --save-dev which records the package as a dependency in your package.json file so that future npm install commands will install that package within the project space.
That said, I happen to know a lot about grunt. It has 2 parts, a globally installed tool and the package-specific tool. The correct way to install it is:
$ [sudo] npm install -g grunt-cli
$ npm install grunt --save-dev
This will install the grunt-cli package into a system location guaranteed to be in the $PATH, which turns around and looks for a package-specific grunt installed which is not system-wide.
When installing nodejs with npm, this one-liner worked for me.
sudo apt-get install nodejs nodejs-dev npm
I don't believe npm comes with the nodejs installation in the apt repo. Try to install npm separately using the following tutorial http://www.giantflyingsaucer.com/blog/?p=1688 'To install NPM ....'
====== Edit ====
node and npm IS separate. Follow the official wiki and everything should be fine