karma start Cannot find module 'jasmine-core'

╄→尐↘猪︶ㄣ 提交于 2019-12-03 04:12:05

I solved using npm install jasmine-core --save-dev

craigstar

try install jasmine-core globally (Jasmine on NPM). use npm install -g jasmine-core

Even with karma and karma-jasmine installed in the local project's node_modules you must still npm install jasmine.

So for a fresh Karma project:

  1. 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.

  1. karma start

This step requires you to have Karma installed globally (sudo npm install -g karma).

Snehal P

Navigate to folder:

cd node_modules\karma-jasmine

Run:

npm install

This should download the required dependencies and fix the issue.

Also, it is important to know the installation path where do you have karma.conf.js file.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!