简体   繁体   English

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

[英]Receive parse error for package.json. Validates as valid json

I'm trying to create my first yeoman generator and I'm getting the following error when I run yo to create my project. 我正在尝试创建我的第一个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

I've validated the package.json file using jsonlint. 我已经使用jsonlint验证了package.json文件。 I've also performed npm cache clean. 我还执行了npm cache clean。 The package.json file can be found here: https://github.com/dereksnow/generator-simple-stylus/blob/master/package.json 可在以下位置找到package.json文件: https : //github.com/dereksnow/generator-simple-stylus/blob/master/package.json

Any suggestions? 有什么建议么?

I had a comma after my last dependency in my app/templates/_package.json file. 我的app / templates / _package.json文件中的最后一个依赖项后出现逗号。 I was looking at the package.json in the root directory which did not have any issues. 我正在查看根目录中的package.json,它没有任何问题。 Oof! 钱币!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM