mocha & chai dependencies when running npm install - npm

I want to run an Ionic app with Grunt (Yeoman Ionic)
To do this the script runs npm install and bower install. Then run grunt to compile and then grunt serve to serve it on local host.
npm install does not create peer dependencies with Mocha and Chai which is making bower install abort like so:
Running "karma:continuous" (karma) task
Warning: Cannot find module 'mocha' Use --force to continue.
Aborted due to warnings.
I ran npm install -g chai mocha then npm install and got the same
npm WARN karma-mocha#0.1.10 requires a peer of mocha#* but none was installed.
npm WARN karma-chai#0.1.0 requires a peer of chai#* but none was installed.
Even though this is a warning it is yielding errors when running yo ionic:
npm WARN karma-chai#0.1.0 requires a peer of chai#* but none was installed.
npm WARN karma-mocha#0.1.10 requires a peer of mocha#* but none was installed.
ERROR: Error: ENOENT: no such file or directory, rename '/Users/donjohnson/ionicNom/app/app/css' -> '/Users/donjohnson/ionicNom/app/app/styles'
ERROR: Error: ENOENT: no such file or directory, rename '/Users/donjohnson/ionicNom/app/app/js' -> '/Users/donjohnson/ionicNom/app/app/scripts'
ERROR: Error: ENOENT: no such file or directory, rename '/Users/donjohnson/ionicNom/app/app/img' -> '/Users/donjohnson/ionicNom/app/app/images'
This makes grunt serve open a browser page with nothing in it :(

npm install --save-dev mocha chai to your project (without the -g).
As of version 3, npm does not automatically install peerDependencies

It seems that with NPM 3, the dependencies won't be installed by default, use this to update:
npm install chai#*
npm install mocha#*
and then use:
npm install
bower install

Related

NPM install not work and make lock-json file

Hi I'm trying to install npm to run a kit.
my node version is: v12.18.3
my npm version is: 6.14.6
my folder is "test" and I'm installing npm with this command:
Kian#DESKTOP-CL16DA7 MINGW64 /d/markitdone/test
$ npm install
npm WARN saveError ENOENT: no such file or directory, open 'D:\markitdone\test\package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open 'D:\markitdone\test\package.json'
npm WARN test No description
npm WARN test No repository field.
npm WARN test No README data
npm WARN test No license field.
up to date in 0.845s
found 0 vulnerabilities
Could someone help me please?
Before you use npm install.
You need to create a project, either React, Vue.js or Angular in your test directory

#vue-cli peer dependency warn

I created project using vue-cli 3, cd into it, ran npm install and got this error:
npm WARN ajv-keywords#2.1.1 requires a peer of ajv#^5.0.0 but none is installed. You must install peer dependencies yourself.
I ran
npm install ajv
Which finished with success, but I'm still getting same warn on npm install
npm install -g npm-install-peers
try this it will add all the missing peers and remove all the error

npm ERR! 404 Not Found: 1.9.1#latest

I cloned a project to my local repo:
$ npm i
npm WARN cropper#3.1.4 requires a peer of jquery#>= 1.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN The package iview is included as both a dev and production dependency.
npm WARN The package vuex is included as both a dev and production dependency.
But when I install the jquery#>= 1.9.1 dependency manually , I get can not found error:
$ npm install jquery#>= 1.9.1 --save-dev
npm ERR! code E404
npm ERR! 404 Not Found: 1.9.1#latest
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/luowensheng/.npm/_logs/2018-02-12T07_13_29_793Z-debug.log
What this line
npm WARN cropper#3.1.4 requires a peer of jquery#>= 1.9.1 but none is installed. You must install peer dependencies yourself.
means is you need to have a jquery version greater than 1.9.1
Just do
npm install jquery#^1.9.1 or npm install jquery#latest if you want the latest jquery version which is 3.x.x

npm failing to install packages with local dependency

I am having problems installing an npm package that has a file dependency off of github. When installing directly from a local package there are no problems.
The package that I am trying to install has a dependency on a package defined within on of its subdirectories.
The error I am getting is as follows:
npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules/local-dependency-example/local-dependency" as it does not contain a package.json file.
I created the following package in order to reproduce: https://github.com/eladzlot/local-dependency-example
In order to reproduce you should create an empty package: npm init.
Then attempt to install: npm install eladzlot/local-dependency-example --save.
This problem occurs both with npm v3.10.10 and npm v5.5.1

Getting error for Karma Tests

I am getting the below error on my karma unit test:
npm WARN karma-coffee-preprocessor#0.1.3 requires a peer of karma#>=0.9 but none was installed.
npm WARN karma-junit-reporter#1.2.0 requires a peer of karma#>=0.9 but none was installed.
npm WARN karma#1.0.0 No description
npm WARN karma#1.0.0 No repository field.
Uninstalled karma and installed it again
$ npm uninstall -g karma
$ npm install karma --save-dev
This worked for me.
I got an error while trying to install it again, saying refusing to install dependency of itself. Change "name" in package.json from "karma" to "karma-test" and it worked. :)