我在OSX上,当我尝试启动以下命令时出现以下错误:
yo aspnet
undefined:6
"bootstrap": "~3.0.3"
^
SyntaxError: Unexpected string
at Object.parse (native)
at EditionInterface.module.exports [as readJSON] (/usr/local/lib/node_modules/generator-aspnet/node_modules/yeoman-generator/node_modules/mem-fs-editor/actions/read-json.js:5:17)
at Base.determineAppname (/usr/local/lib/node_modules/generator-aspnet/node_modules/yeoman-generator/lib/base.js:735:25)
at Base (/usr/local/lib/node_modules/generator-aspnet/node_modules/yeoman-generator/lib/base.js:150:23)
at new yeoman.generators.Base.extend.constructor (/usr/local/lib/node_modules/generator-aspnet/app/index.js:9:32)
at Environment.instantiate (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:282:10)
at Environment.create (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:259:15)
at Environment.run (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:318:24)
at /usr/local/lib/node_modules/yo/lib/cli.js:86:9
at Environment.resolver.lookup (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/resolver.js:50:12)
我是 npm 的大菜鸟,所以有人可以帮助我并告诉我如何解决这个问题?
问题是生成器正在尝试读取 JSON 文件。但该 JSON 文件包含无效的 JSON 语法,因此生成器无法读取它。
也许您使用无效语法编辑了 JSON 文件?
如果您没有修改任何 json 文件,那么您应该在生成器 aspnet 上打开一个问题。