I'm cloning a repo with Yeoman, what configuration do I need on my computer? - node.js

I have cloned a repo that has Yeoman installed.
I installed node, as well as Yeoman npm i -g yo. When I run grunt I get an error stating:
Error: Cannot find module 'load-grunt-tasks'
Warning: Task "default" not found. Use --force to continue.
What else do I need to do to be able to run this repo successfully?

The first time, you have to run npm install.
This will install all the needed dependencies as described in the package.json
Subsequently, if anyone add a new dependency into this file, you will need to run npm install or npm update again.

Actually besides npm, you should also download bower dependencies.
So it's 2-step:
npm install
bower install
If you don't invoke bower application may launch, but later you may encounter problems such as the lack of libraries.

Related

node modules deleted. now npm is not installing

I deleted the node modules and package.json.lock file in my client side MERN Stack project folder and tried reinstalling the node modules by typing "npm install" command in the terminal. but it's showing me an error. 1. I have tried clearing cache using "npm cache clean --force".
2. I have tried reinstalling npm using "npm install -g npm".
3. I have tried updating the npm using "npm install -g npm#latest".
But nothing works. Please help me resolve this issue. below are my package.json file and the error in my terminal while installing node modules.
i was expecting that node modules will be reinstalled with all the dependencies mentioned in my package.json file.
NPM changed the way of resolving peer dependencies in v7, but this new way does not allow conflicting dependencies in the dependency tree. The simplest way to solve this would be to use the --legacy-peer-deps option to use the old way of resolving dependencies.
The hard(but better) way to solve it would be to spend some time to update the dependencies in a way that there is no conflicting dependency.

node js npm package installation not completed

I try to install node js npm packages, but It start to install and unfortunately freezes. I also try to install angular packages and it doesn't any problem. please help to fix this issue.
node version is 12.13.1;
npm version is 6.12.1;
I tried to install packages this way
npm i html-to-xlsx
here is a result:
another installation result:
Try the following commands then re-run the command:
npm cache clean --force
npm cache verify
And make sure you are in a place with good internet connection. Sometimes this is the issue.
I found way to fix this issue. I add -g before package name
npm install -g html-to-xlsx
Everything looks good
After that I enter this path C:\Users{USERNAME}\AppData\Roaming\npm\node_modules and copy needful module into my working folder

grunt-bower-task throws "Warning: Cannot find module 'bower' Use --force to continue."

When doing grunt bower:install grunt throws the following error
kaushiks-MacBook-Pro:ama ghost$ grunt bower:install
Running "bower:install" (bower) task
Warning: Cannot find module 'bower' Use --force to continue.
Aborted due to warnings.
kaushiks-MacBook-Pro:ama ghost$
I have tried npm install bower -g but still din't work. Please help.
You probably need Bower as a local dependency and not global. If you are using grunt-bower-task you should've downloaded Bower from its dependencies already - but since the error specifically says that it cannot find module bower you should install it locally in your project's root with npm install bower -D.
The -D option is shorthand for --save-dev which only installs the dependency if NODE_ENV environment variable is development, which it is by default.

"grunt install" returns error on Ubuntu

I get the following error when I try to run "grunt install" on a Ubuntu 14.04 box that has the latest nodejs installed from NodeSource.
jit-grunt: Plugin for the "install" task not found. If you have
installed the plugin already, please setting the static mapping. See
https://github.com/shootaroo/jit-grunt#static-mappings
Warning: Task "install" failed. Use --force to continue.
Aborted due to warnings.
Here is the part of Gruntfile.js related to jit-grunt:
require('jit-grunt')(grunt, {
express: 'grunt-express-server',
useminPrepare: 'grunt-usemin',
ngtemplates: 'grunt-angular-templates',
cdnify: 'grunt-google-cdn',
protractor: 'grunt-protractor-runner',
injector: 'grunt-asset-injector',
buildcontrol: 'grunt-build-control'
});
Can someone point to the right direction?
What is the grunt install task? Can you please paste your package.json file here so we may see your dependencies?
The reason jit-grunt is outputting that error is because it cannot find a node module folder named grunt-contrib-install, grunt-install, or install, with a tasks/ folder with JS files that register a Grunt task named install.
Do you mean either of these packages? If so, you have to call them via their registered task names:
- https://www.npmjs.org/package/grunt-npm-install – grunt npm-install
- https://www.npmjs.org/package/grunt-auto-install – grunt auto_install
For the grunt-auto-install package, you will need to add it to jit-grunt's static mappings, like you have with grunt-express-server and others.
If it's not the above, apart from "maybe you mistyped?", the only other answer I can offer is similar to the assumption #waqas-ahmed made: that you mean to install dependencies and devDependencies from your package.json file, and that perhaps you mean to call npm install, not grunt install.
Try as below:
1) npm install -g grunt-cli
This will put the grunt command in your system path, allowing it to be run from any directory.
Note that installing grunt-cli does not install the Grunt task runner! The job of the Grunt CLI is simple: run the version of Grunt which has been installed next to a Gruntfile. This allows multiple versions of Grunt to be installed on the same machine simultaneously.
2) npm install grunt --save-dev
The easiest way to add Grunt and gruntplugins to an existing package.json is with the command npm install --save-dev. Not only will this install locally, but it will automatically be added to the devDependencies section, using a tilde version range.
for further assistance follow this link
http://gruntjs.com/getting-started

grunt init:node not working

I'm trying to do an intro grunt tutorial. I've installed git, node.js, and grunt globally (or at least I thought I did using: npm install -g grunt (which installs). I then made a quick directory and entered it (mkdir demo, cd demo), but when I type:
> grunt init:node
at the prompt I get the following:
grunt-cli: The grunt command line interface (v0.1.11)
Fatal error: unable to find local grunt
If you're seeing this message, either a Gruntfile wasn't found or hasn't been installed locally to your project. For more information about installing and configuring grunt, please see the Getting Started guide:
http://gruntjs.com/getting-started
Which I've looked at and it says to do what I'm doing and what the tutorial mentions??? Any ideas what I've done wrong? Node.js and Git have been working fine so I can only assume it is grunt or the install that has failed.
Thanks
with grunt you need two elements. a global grunt-cli as you have installed using npm install -g grunt-cli and also a local (to the project) copy of grunt itself. so in the folder of your project install this with npm install grunt --saveDev this will install a local grunt and also add it to your devDependencies in your package.json file. you will also need a Gruntfile.js in the project folder. This is a great write-up http://www.integralist.co.uk/Grunt-Boilerplate.html

Resources