hupe1980 / cdkdx

Zero-config CLI for aws cdk development
MIT License
38 stars 8 forks source link

Error: The "package.json" file must specify the "repository" attribute #4

Closed rayou closed 4 years ago

rayou commented 4 years ago

It seems repository attribute is missing in package.json for jsii lib template, please see error below:

$ npx cdkdx build

 demo/index.js ⏤  1.18 kB (+1.18 kB)

 DONE  Compiled successfully in 3587ms                                                                                                              2:43:32 pm

Internal Error: Command failed with exit code 255: /Users/ray.ou/Repository/my-jsii-construct/node_modules/jsii/bin/jsii --project-references --silence-warnings=reserved-word
Error: Error: The "package.json" file must specify the "repository" attribute

After added repository attribute to package.json, the project is successfully built.

  // Add this to package.json
  "repository": {
    "type": "git",
    "url": "https://github.com/rayou/test.git"
  },
$ npx cdkdx build

 demo/index.js ⏤  1.18 kB

 DONE  Compiled successfully in 2253ms                                                                                                              2:56:20 pm

 DONE  Project my-jsii-construct compiled in 9.336ms.
hupe1980 commented 4 years ago

Oh yes right. But with the combination of author and project name we can make a sensible assumption. I'll fix it in a moment