Перейти к содержимому

Npm fund что такое

  • автор:

What does ‘x packages are looking for funding’ mean when running `npm install`?

I usually get «x packages are looking for funding.» when running npm install on a react project. Any idea what that means?

10.4k 8 8 gold badges 42 42 silver badges 56 56 bronze badges
asked Nov 21, 2019 at 10:07
Adam Hassan Adam Hassan
5,350 2 2 gold badges 9 9 silver badges 11 11 bronze badges

Moderator Note: This question is now being discussed on Meta. Please take all discussion about whether or not it is on-topic there, instead of leaving comments here.

Jan 29, 2020 at 19:53

10 Answers 10

When you run npm update in the command prompt, when it is done it will recommend you type a new command called npm fund .

When you run npm fund it will list all the modules and packages you have installed that were created by companies or organizations that need money for their IT projects. You will see a list of webpages where you can send them money. So «funds» means «Angular packages you installed that could use some money from you as an option to help support their businesses».

It’s basically a list of the modules you have that need contributions or donations of money to their projects and which list websites where you can enter a credit card to help pay for them.

116k 27 27 gold badges 235 235 silver badges 440 440 bronze badges
answered Apr 3, 2020 at 3:26
12.7k 2 2 gold badges 35 35 silver badges 24 24 bronze badges

Note that this a npm feature, it’s not specific to Angular. You would get that same message with React or Vue or anything else.

Aug 14, 2020 at 19:04

Up until now I thought npm fund did something regarding dependency resolution. So this answer gets an upvote.

Sep 18, 2020 at 21:42
Interesting. I really thought of it when read the message, but googled it just to be sure
Jan 17, 2022 at 8:14

Same here. I think most of the people who use node also thought that npm fund will fix some issues regarding package dependency.

npm-fund

This command retrieves information on how to fund the dependencies of a given project. If no package name is provided, it will list all dependencies that are looking for funding in a tree structure, listing the type of funding and the url to visit. If a package name is provided then it tries to open its funding url using the —browser config param; if there are multiple funding sources for the package, the user will be instructed to pass the —which option to disambiguate.

The list will avoid duplicated entries and will stack all packages that share the same url as a single entry. Thus, the list does not have the same shape of the output from npm ls .

Example

Workspaces support

It’s possible to filter the results to only include a single workspace and its dependencies using the workspace config option.

Example:

Here’s an example running npm fund in a project with a configured workspace a :

$ npm fund
test-workspaces-fund@1.0.0
+-- https://example.com/a
| | `-- a@1.0.0
| `-- https://example.com/maintainer
| `-- foo@1.0.0
+-- https://example.com/npmcli-funding
| `-- @npmcli/test-funding
`-- https://example.com/org
`-- bar@2.0.0

And here is an example of the expected result when filtering only by a specific workspace a in the same project:

$ npm fund -w a
test-workspaces-fund@1.0.0
`-- https://example.com/a
| `-- a@1.0.0
`-- https://example.com/maintainer
`-- foo@2.0.0

Configuration

json
  • Default: false
  • Type: Boolean

Whether or not to output JSON data, rather than the normal output.

  • In npm pkg set it enables parsing set values with JSON.parse() before saving them to your package.json .

Not supported by all npm commands.

browser
  • Default: OS X: «open» , Windows: «start» , Others: «xdg-open»
  • Type: null, Boolean, or String

The browser that is called by npm commands to open websites.

Set to false to suppress browser behavior and instead print urls to terminal.

Set to true to use default system URL opener.

unicode
  • Default: false on windows, true on mac/unix systems with a unicode locale, as defined by the LC_ALL , LC_CTYPE , or LANG environment variables.
  • Type: Boolean

When set to true, npm uses unicode characters in the tree output. When false, it uses ascii characters instead of unicode glyphs.

workspace
  • Default:
  • Type: String (can be set multiple times)

Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option.

Valid values for the workspace config are either:

  • Workspace names
  • Path to a workspace directory
  • Path to a parent workspace directory (will result in selecting all workspaces within that folder)

When set for the npm init command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project.

This value is not exported to the environment for child processes.

which
  • Default: null
  • Type: null or Number

If there are multiple funding sources, which 1-indexed source URL to open.

Что за fund и vulnerabilities, почему npm перестал без ошибок ставить некоторые пакеты?

Версия npm 7.20.6
После опустил до 6.14.14
Но так же осталось, что в gulp и webpack стали прилетать vulnerabilities и предложения сделать audit и fund
Никакие команды, которые советуют npm не помогают, vulnerabilities так же остаются.
Версия node 16.6.1

А вот к примеру electron поставился хорошо.

  • Вопрос задан более двух лет назад
  • 230 просмотров

3 комментария

Простой 3 комментария

npm-fund

Эта команда извлекает информацию о том, как финансировать зависимости данного проекта. Если имя пакета не указано, он перечислит все зависимости, которые ищут финансирование, в древовидной структуре, перечислив тип финансирования и URL-адрес для посещения. Если указано имя пакета, он пытается открыть свой URL-адрес для финансирования, используя параметр конфигурации —browser ; если для пакета имеется несколько источников финансирования, пользователю будет предложено указать параметр —which для устранения неоднозначности.

Список позволит избежать дублирования записей и будет объединять все пакеты с одним и тем же URL-адресом в одну запись. Таким образом, список не имеет такой же формы, как вывод из npm ls .

Example

Workspaces support

Можно отфильтровать результаты, чтобы включить только одну рабочую область и ее зависимости, используя параметр конфигурации workspace .

Example:

Вот пример запуска npm fund в проекте с настроенным рабочим пространством a :

$ npm fund test-workspaces-fund@1.0.0 +-- https://example.com/a | | `-- a@1.0.0 | `-- https://example.com/maintainer | `-- foo@1.0.0 +-- https://example.com/npmcli-funding | `-- @npmcli/test-funding `-- https://example.com/org `-- bar@2.0.0

А вот пример ожидаемого результата при фильтрации только по конкретному рабочему пространству a в том же проекте:

$ npm fund -w a test-workspaces-fund@1.0.0 `-- https://example.com/a | `-- a@1.0.0 `-- https://example.com/maintainer `-- foo@2.0.0

Configuration

json
  • Default: false
  • Type: Boolean

Следует ли выводить данные JSON вместо обычного вывода.

  • В npm pkg set он позволяет анализировать заданные значения с помощью JSON.parse() перед их сохранением в package.json .

Не поддерживается всеми командами npm.

browser
  • По умолчанию: OS X: «open» , Windows: «start» , другие: «xdg-open»
  • Тип: null, Boolean или строка

Браузер, который вызывается командой npm для открытия веб-сайтов.

Установите значение false , чтобы подавить поведение браузера и вместо этого выводить URL-адреса на терминал.

Установите значение true , чтобы использовать системный открыватель URL по умолчанию.

unicode
  • По умолчанию: false в Windows, true в системах mac/unix с языковым стандартом Unicode, как определено переменными среды LC_ALL , LC_CTYPE или LANG .
  • Type: Boolean

Если задано значение true, npm использует символы Юникода в выводе дерева. Когда false, он использует символы ascii вместо глифов Unicode.

workspace
  • Default:
  • Тип: Строка (можно указать несколько раз)

Включите запуск команды в контексте настроенных рабочих областей текущего проекта при фильтрации путем запуска только рабочих областей, определенных этим параметром конфигурации.

Допустимые значения для конфигурации workspace :

  • Workspace names
  • Путь к каталогу рабочей области
  • Путь к каталогу родительской рабочей области (приведет к выбору всех рабочих областей в этой папке)

При установке для команды npm init это может быть установлено для папки рабочей области, которая еще не существует, чтобы создать папку и настроить ее как новую рабочую область в проекте.

Это значение не экспортируется в среду для дочерних процессов.

which
  • Default: null
  • Тип: null или номер

Если есть несколько источников финансирования, какой 1-индексированный источник URL открыть.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *