接收package.json的解析错误.验证为有效的json

Receive parse error for package.json. Validates as valid json

本文关键字:json 验证 有效 错误 package 接收      更新时间:2023-10-17

我正试图创建我的第一个yeoman生成器,当我运行yo创建我的项目时,我遇到了以下错误。

npm ERR! install Couldn't read dependencies
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.35
npm ERR! npm  v2.1.14
npm ERR! file /Users/derek/Development/personal_projects/stylus-generator/work/package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! Unexpected token }
npm ERR! File: /Users/derek/Development/personal_projects/stylus-generator/work/package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse
npm ERR! Please include the following file with any support request:
npm ERR!     /Users/derek/Development/personal_projects/stylus-generator/work/npm-debug.log

我已经使用jsonint验证了package.json文件。我还执行了npm缓存清理。package.json文件可以在这里找到:https://github.com/dereksnow/generator-simple-stylus/blob/master/package.json

有什么建议吗?

我在app/templates/_package.json文件中的最后一个依赖项后面有一个逗号。我在根目录中查看了package.json,它没有任何问题。哎哟!