Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Json 由于因果报应,无法成功运行npm安装:未安装_Json_Node.js_Gruntjs_Npm Install - Fatal编程技术网

Json 由于因果报应,无法成功运行npm安装:未安装

Json 由于因果报应,无法成功运行npm安装:未安装,json,node.js,gruntjs,npm-install,Json,Node.js,Gruntjs,Npm Install,我有一个package.json文件,其中提到了以下devdependency: { "name": "tabs-torico", "version": "1.0.0", "dependencies": {}, "devDependencies": { "grunt": "~0.4.2", "grunt-angular-templates": "~0.5.1", "grunt-autoprefixer": "~0.4.0", "grunt-cli": "~0.1.11", "g

我有一个package.json文件,其中提到了以下devdependency:

{  "name": "tabs-torico",
  "version": "1.0.0",
  "dependencies": {},
  "devDependencies": {
  "grunt": "~0.4.2",
"grunt-angular-templates": "~0.5.1",
"grunt-autoprefixer": "~0.4.0",
"grunt-cli": "~0.1.11",
"grunt-concurrent": "~0.4.1",
"grunt-connect-proxy": "~0.1.7",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-compass": "~0.6.0",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-connect": "~0.5.0",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-cssmin": "~0.7.0",
"grunt-contrib-htmlmin": "~0.1.3",
"grunt-contrib-jshint": "~0.7.1",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-watch": "^0.5.3",
"grunt-karma": "~0.6.2",
"grunt-newer": "~0.5.4",
"grunt-ngmin": "~0.0.2",
"grunt-protractor-runner": "~0.2.1",
"grunt-rev": "~0.1.0",
"grunt-usemin": "~2.0.0",
"jasmine-core": "^2.6.2",
"jshint-stylish": "~0.1.3",
"karma": "^0.10.10",
"karma-chrome-launcher": "^0.1.12",
"karma-html2js-preprocessor": "~0.1.0",
"karma-jasmine": "^0.1.6",
"karma-ng-html2js-preprocessor": "~0.1.0",
"karma-ng-scenario": "~0.1.0",
"karma-requirejs": "~0.2.1",
"karma-script-launcher": "~0.1.0",
"load-grunt-tasks": "~0.2.0",
"phantomjs": "^2.1.7",
"phantomjs-prebuilt": "^2.1.14",
"protractor": "~0.18.1",
"requirejs": "~2.1.10",
"time-grunt": "~0.2.1"
 },
 "engines": {
"node": ">=0.8.0"
},
 "scripts": {
   "test": "grunt test"
}
}
现在,当我运行npm安装时,会出现以下错误:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 
fsevents@github:pipobscure/fseve
nts#7dcdf9fa3f8956610fd6f69f72c67bace2de7138 
(node_modules\chokidar\node_modules
\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 
fsevents@
0.2.1: wanted {"os":"darwin","arch":"any"} (current: 
{"os":"win32","arch":"x64"}
)
npm WARN karma@0.10.10 requires a peer of karma-coffee-preprocessor@~0.1.0 
but none was installed.
npm WARN karma@0.10.10 requires a peer of karma-firefox-launcher@~0.1.0 but 
none was installed.
npm WARN karma@0.10.10 requires a peer of karma-phantomjs-launcher@~0.1.0 
but none was installed.

运行npm install会安装package.json中提到的所有依赖项吗?还是我需要分别安装jasmine core和karma jasmine?

npm install会安装package.json中指定的所有依赖项。您应该在节点模块文件夹中找到。

这是您的karma版本的问题。 在package.json文件中,包含以下行,而不是当前的karma行

"karma": "^0.11.14"
另外,需要注意的是,如果您使用的是karma chrome launcher 您还需要将其包含在package.json文件中,因为新版本的karma没有随附

因此,也包括以下几行

"karma-chrome-launcher": "^0.1.2"
我希望这能解决你的问题