npm / cli

the package manager for JavaScript
https://docs.npmjs.com/cli/
Other
8.43k stars 3.14k forks source link

[BUG] npm fund throws error about no funding information #1316

Closed fishcharlie closed 3 years ago

fishcharlie commented 4 years ago

What / Why

n/a

When

Where

How

Current Behavior

charliefish@Charlies-MacBook-Pro tmpfund % npm fund
tmpfund@1.0.0
├─┬ https://github.com/sponsors/fishcharlie
│ └── dynamoose@2.2.0
├─┬ https://opencollective.com/dynamoose
│ └── dynamoose@2.2.0
├─┬ https://opencollective.com/typescript-eslint
│ └── @typescript-eslint/eslint-plugin@2.30.0, @typescript-eslint/parser@2.30.0, @typescript-eslint/experimental-utils@2.30.0, @typescript-eslint/typescript-estree@2.30.0
├─┬ https://opencollective.com/eslint
│ └── eslint@6.8.0
├─┬ https://opencollective.com/mochajs
│ └── mocha@7.1.2
├─┬ https://github.com/sponsors/mysticatea
│ └── regexpp@3.1.0
├─┬ https://github.com/sponsors/isaacs
│ └── glob@7.1.6, rimraf@3.0.2
├─┬ https://github.com/sponsors/sindresorhus
│ └── globals@12.4.0, ansi-escapes@4.3.1, figures@3.2.0, type-fest@0.11.0, p-limit@2.2.2, make-dir@3.0.2
├─┬ https://github.com/chalk/ansi-styles?sponsor=1
│ └── ansi-styles@4.2.1
├─┬ https://github.com/sponsors/jonschlinkert
│ └── picomatch@2.2.2
├─┬ https://github.com/sponsors/ljharb
│ └── object.getownpropertydescriptors@2.1.0, es-abstract@1.17.5, es-to-primitive@1.2.1, has-symbols@1.0.1, is-callable@1.1.5, is-regex@1.0.5, object-inspect@1.7.0, string.prototype.trimleft@2.1.2, string.prototype.trimright@2.1.2, is-date-object@1.0.2, is-symbol@1.0.3, string.prototype.trimstart@1.0.1, string.prototype.trimend@1.0.1, resolve@1.15.1
├─┬ https://github.com/avajs/find-cache-dir?sponsor=1
│ └── find-cache-dir@3.3.1
└─┬ https://opencollective.com/babel
  └── @babel/core@7.9.0

charliefish@Charlies-MacBook-Pro tmpfund % npm fund dynamoose --which=1
npm ERR! code ENOFUND
npm ERR! No valid funding method available for: dynamoose

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/charliefish/.npm/_logs/2020-05-17T04_29_57_156Z-debug.log

Steps to Reproduce

The package.json for the local package has:

  "funding": [
    {
      "type": "individual",
      "url": "https://github.com/sponsors/fishcharlie"
    },
    {
      "type": "opencollective",
      "url": "https://opencollective.com/dynamoose"
    }
  ]

Expected Behavior

Who

References

ljharb commented 4 years ago

https://unpkg.com/browse/dynamoose@2.2.0/package.json has no funding information, so i'm not sure why dynamoose would be showing up in your npm fund output in the first place.

Since the implication is that you're doing local edits to "try out" what it would look like, can you please share your modified package.json?

fishcharlie commented 4 years ago

Below is my modified package.json file that was on my local disk when I tried to install it from a different directory.

As you mentioned, I did just want to try it out and test it before pushing the changes. I found an RFC that mentioned support for array's in the funding section. However the documentation is pretty awful (https://docs.npmjs.com/configuring-npm/package-json.html#funding), as it has no mention of array support. Nor does it give any details about what you are allowed to put in the type field or how the type field is used.

So due to the lack of documentation, I'm unsure if I'm doing it right. Which is why I wanted to test it.

{
  "name": "dynamoose",
  "version": "2.2.0",
  "description": "Dynamoose is a modeling tool for Amazon's DynamoDB (inspired by Mongoose)",
  "main": "dist/index.js",
  "types": "dist/index.d.ts",
  "homepage": "https://dynamoosejs.com",
  "directories": {
    "doc": "docs"
  },
  "devDependencies": {
    "@typescript-eslint/eslint-plugin": "^2.30.0",
    "@typescript-eslint/parser": "^2.30.0",
    "chai": "^4.2.0",
    "chai-as-promised": "^7.1.1",
    "eslint": "^6.8.0",
    "mocha": "^7.1.2",
    "nyc": "^15.0.1",
    "typescript": "^3.8.3"
  },
  "scripts": {
    "prepare": "npm run build:clean; npm run build",
    "build": "tsc",
    "build:clean": "rm -rf dist",
    "build:watch": "npm run build -- -w",
    "test:nocoverage": "mocha",
    "test": "nyc npm run test:nocoverage",
    "test:debug": "npm run test:nocoverage -- --no-timeout --inspect=9229",
    "test:debug:breakpoint": "npm run test:nocoverage -- --no-timeout --inspect-brk=9229",
    "lint": "eslint . --ext .ts,.js --max-warnings 0",
    "lint:fix": "npm run lint -- --fix",
    "site:install": "cd docs && npm install",
    "site:start": "cd docs && npm start",
    "site:build": "cd docs && npm run build",
    "site:swizzle": "cd docs && npm run swizzle"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/dynamoose/dynamoose.git"
  },
  "author": {
    "name": "Charlie Fish",
    "email": "fishcharlie.code@gmail.com",
    "url": "https://charlie.fish"
  },
  "contributors": [
    {
      "name": "Brandon Goode"
    }
  ],
  "bugs": {
    "url": "https://github.com/dynamoose/dynamoose/issues"
  },
  "dependencies": {
    "@types/node": "^13.13.4",
    "@types/source-map-support": "^0.5.1",
    "aws-sdk": "^2.668.0",
    "source-map-support": "^0.5.19",
    "uuid": "^8.0.0"
  },
  "license": "Unlicense",
  "keywords": [
    "dynamodb",
    "dynamo",
    "mongoose",
    "aws",
    "amazon",
    "document",
    "model",
    "schema",
    "database",
    "data",
    "datastore",
    "query",
    "scan",
    "nosql",
    "db",
    "nosql",
    "store",
    "document store",
    "table",
    "json",
    "object",
    "storage"
  ],
  "engines": {
    "node": ">=8.0.0"
  },
  "files": [
    "dist"
  ],
  "funding": [
    {
      "type": "individual",
      "url": "https://github.com/sponsors/fishcharlie"
    },
    {
      "type": "opencollective",
      "url": "https://opencollective.com/dynamoose"
    }
  ]
}
ljharb commented 4 years ago

The “type” isn’t particularly useful, but yes, that’s correct.

It can be a url string, an object, or an array of either.

darcyclarke commented 3 years ago

npm v6 is no longer in active development; We will continue to push security releases to v6 at our team's discretion as-per our Support Policy.

If your bug is reproducible on v7, please re-file this issue using our new issue template.

If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo

Closing: This is an automated message.