Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package.json文件是怎么生成的 #1

Open
anita-anita opened this issue May 12, 2017 · 5 comments
Open

package.json文件是怎么生成的 #1

anita-anita opened this issue May 12, 2017 · 5 comments

Comments

@anita-anita
Copy link

bogon:umeng anita$ cordova plugin add /Users/anita/PluginAndDemo/plugin/cordova-plugin-umeng
Error: npm: Command failed with exit code 1 Error output:
npm ERR! file /Users/anita/PluginAndDemo/plugin/cordova-plugin-umeng/package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! Unexpected token '/' at 2:42
npm ERR! "name": "cordova-plugin-umeng", // plugin名称
npm ERR! ^
npm ERR! File: /Users/anita/PluginAndDemo/plugin/cordova-plugin-umeng/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! A complete log of this run can be found in:
npm ERR! /Users/anita/.npm/_logs/2017-05-12T07_45_02_877Z-debug.log
bogon:umeng anita$

@ryouaki
Copy link
Member

ryouaki commented May 12, 2017

请问一下,你这个是自己建立的一个cordova项目,然后往里面添加自己的plugin?

@ryouaki
Copy link
Member

ryouaki commented May 12, 2017

可以执行npm init生成package.json文件

@anita-anita
Copy link
Author

哦哦,我是要写一个友盟统计的插件,以前我写的插件都没有package.json文件,不知道现在怎么都要package.json文件,是执行命令行 npm init package.json吗?

@ryouaki
Copy link
Member

ryouaki commented May 12, 2017

就是 # npm init
你可以可以用我做的插件生成工具 连接

@anita-anita
Copy link
Author

好的,谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants