I was getting the following error when I ran \"karma start\"
module.js:340 throw err; ^ Error: Cannot find module \'jasmine-core\' at
I have this problem, and have tried every suggestion on the page without it fixing the problem. Well, I haven't yet rebooted, so I'll try that next, but I have closed my shell (git-bash) and re-opened it in case it was an environment variable problem. Something is wrong here and I don't think the problem has been identified yet.
Even with karma
and karma-jasmine
installed in the local project's node_modules
you must still npm install jasmine
.
npm install karma karma-jasmine jasmine
to install the required modules locally.Optionally add --save-dev
to write to your package.json
.
Note these do not need to be -g
globally installed here.
karma start
This step requires you to have Karma installed globally (sudo npm install -g karma
).
Also, it is important to know the installation path where do you have karma.conf.js file.
Navigate to folder:
cd node_modules\karma-jasmine
Run:
npm install
This should download the required dependencies and fix the issue.
try install jasmine-core
globally (Jasmine on NPM).
use npm install -g jasmine-core
I solved using npm install jasmine-core --save-dev