Col*_*lin 7 node.js npm cordova ionic
我最近安装了Node.js,npm,ionic和cordova,如Ionic入门中所述
现在,当我打开Visual Studio项目时,Bower/NPM窗口显示以下错误:
System.AggregateException:发生一个或多个错误.---> Microsoft.NodejsTools.Npm.PackageJsonException:在'C:\ Users\Colin\AppData\Roaming \npm \node_modules\cordova \node_modules \npm \node_modules\graceful-fs\package.json'中读取package.json时出错:读取package.json时出错.该文件可能是可解析的JSON,但可能包含具有重复属性的对象.
这似乎是由于npm包的问题.那么我该如何解决这个问题呢?我是否安装了早期版本的Node,npm,cordova或graceful-fs?我该怎么做?
编辑 在Vikas Vats的评论之后,我运行了以下命令:
cordova -v 我被告知我的全球版本是5.3.3
npm uninstall -g cordova
npm install -g cordova@4.3.0
我现在得到报告的相同错误,graceful-fs\package.json但这次它位于不同的位置:
C:\ Users \用户科林\应用程序数据\漫游\ NPM \node_modules \离子\node_modules \离子-APP-LIB \node_modules \离子-科尔多瓦-LIB \node_modules\NPM \node_modules \优美-FS \的package.json
我卸载了 cordova - 将其恢复到 Visual Studio 已测试的版本:
npm uninstall -g cordova
npm install -g cordova@4.3.0
这将错误移至离子。所以我然后将 Ionic 恢复到 1.6.5 版本:
npm uninstall -g ionic
npm install -g ionic@1.6.5
这修复了 Graceful-fs/package.json 文件。我把内容复制到这里:
{
  "author": {
    "name": "Isaac Z. Schlueter",
    "email": "i@izs.me",
    "url": "http://blog.izs.me"
  },
  "name": "graceful-fs",
  "description": "A drop-in replacement for fs, making various improvements.",
  "version": "2.0.0",
  "repository": {
    "type": "git",
    "url": "git://github.com/isaacs/node-graceful-fs.git"
  },
  "main": "graceful-fs.js",
  "engines": {
    "node": ">=0.4.0"
  },
  "directories": {
    "test": "test"
  },
  "scripts": {
    "test": "tap test/*.js"
  },
  "keywords": [
    "fs",
    "module",
    "reading",
    "retry",
    "retries",
    "queue",
    "error",
    "errors",
    "handling",
    "EMFILE",
    "EAGAIN",
    "EINVAL",
    "EPERM",
    "EACCESS"
  ],
  "license": "BSD",
  "readme": "# graceful-fs\n\ngraceful-fs functions as a drop-in replacement for the fs module,\nmaking various improvements.\n\nThe improvements are meant to normalize behavior across different\nplatforms and environments, and to make filesystem access more\nresilient to errors.\n\n## Improvements over fs module\n\ngraceful-fs:\n\n* keeps track of how many file descriptors are open, and by default\n  limits this to 1024. Any further requests to open a file are put in a\n  queue until new slots become available. If 1024 turns out to be too\n  much, it decreases the limit further.\n* fixes `lchmod` for Node versions prior to 0.6.2.\n* implements `fs.lutimes` if possible. Otherwise it becomes a noop.\n* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or\n  `lchown` if the user isn't root.\n* makes `lchmod` and `lchown` become noops, if not available.\n* retries reading a file if `read` results in EAGAIN error.\n\nOn Windows, it retries renaming a file for up to one second if `EACCESS`\nor `EPERM` error occurs, likely because antivirus software has locked\nthe directory.\n\n## Configuration\n\nThe maximum number of open file descriptors that graceful-fs manages may\nbe adjusted by setting `fs.MAX_OPEN` to a different number. The default\nis 1024.\n",
  "readmeFilename": "README.md",
  "bugs": {
    "url": "https://github.com/isaacs/node-graceful-fs/issues"
  },
  "_id": "graceful-fs@2.0.0",
  "_from": "graceful-fs@2"
}
我还尝试了下一个 Ionic 版本 -1.7.0以及最新的版本 - 1.7.7。问题又出现了,所以我暂时坚持使用 1.6.5
参考 Ionic 版本
| 归档时间: | 
 | 
| 查看次数: | 1063 次 | 
| 最近记录: |