我不能npm install在NodeJS中使用命令提示符.我在运行时遇到这些错误npm install:
module.js:339
throw err;
^
Error: Cannot find module 'semver'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (C:\Users\admin\AppData\Roaming\npm\node_modules\npm\l
ib\config\defaults.js:6:14)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
Run Code Online (Sandbox Code Playgroud)
请帮我
我安装了以下测试:
"devDependencies": {
"jasmine-core": "^2.4.1",
"karma": "^0.13.22",
"karma-jasmine": "^0.3.7",
"karma-phantomjs-launcher": "^1.0.0"
}
Run Code Online (Sandbox Code Playgroud)
运行后karma start我收到以下错误:
进行搜索这是第一个有同样问题的问题:karma start无法找到模块'jasmine-core'
但是我已经尝试了两个答案,jasmine-core全球安装,我已经做了npm install jasmine-core --save-dev:(
我的 test/index.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Jasmine Spec Runner</title>
<link href="testing.css" rel="stylesheet">
<script src="../app/assets/js/libs/vendors.min.js"></script>
<script src="../app/assets/js/bundle.js"></script>
</head>
<body>
<div>
<header>
<h1>Jasmine tests for Dashboard</h1>
</header>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我的 karma.conf.js
// Karma configuration
// Generated on Mon Mar 14 2016 11:56:04 GMT-0500 (CDT)
module.exports = function(config) {
config.set({
// base path that …Run Code Online (Sandbox Code Playgroud)