karma start Cannot find module 'jasmine-core'

后端 未结 6 1306
深忆病人
深忆病人 2021-02-06 21:11

I was getting the following error when I ran \"karma start\"

module.js:340 throw err; ^ Error: Cannot find module \'jasmine-core\' at

6条回答
  •  滥情空心
    2021-02-06 21:44

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

提交回复
热议问题