GithubHelp home page GithubHelp logo

tobyandtoby / generate-license-file Goto Github PK

View Code? Open in Web Editor NEW
54.0 3.0 10.0 7.54 MB

Generates a text file containing all of the licences for your production dependencies

Home Page: https://generate-license-file.js.org

License: ISC License

JavaScript 3.55% TypeScript 68.64% CSS 3.00% MDX 24.81%
cli license licence generator third-party third-party-libraries npm oss nodejs third-party-licenses

generate-license-file's Introduction

Generate License File

A CLI and code library to generate a text file containing all of the licenses for your production third-party dependencies.

npm

Installation and Usage (CLI)

$ npm install generate-license-file --save-dev

$ npx generate-license-file --input package.json --output third-party-licenses.txt --overwrite
Argument Description
--input Absolute or relative path to the package.json for the project.
--output Absolute or relative path for the generated output file.
--overwrite (optional) Allows the CLI to overwrite existing output files. If this option is not provided and the output file already exists, you will be prompted to confirm.
--eol (optional) Specify the line endings used in the output file. Accepted values are crlf or lf. If no value is provided your system default will be used.
--ci (optional) Stops the CLI from prompting the user for inputs and instead exits with a non-zero exit code.
--no-spinner (optional) Disable the CLI spinner while the output file is being generated.
--config (optional) Specify the path to a generate-license-file config file at a non-standard location.
--version (optional) Print the installed generate-license-file version.

If either the --input or --output are omitted the CLI will prompt you for their values.

For a full description of the CLI arguments and their usages please see the relevant docs page.

Installation and Usage (Library API)

$ npm install generate-license-file --save-dev

TypeScript

import { generateLicenseFile, getLicenseFileText, getProjectLicenses } from "generate-license-file";

// Generate the license file and write it to disk.
await generateLicenseFile("./package.json", "./third-party-licenses.txt");

// Generate the license file content and return it as a string.
const licenseFileText: string = await getLicenseFileText("./package.json");

// Get an array of objects each containing the details of an
// identified license and the dependencies it pertains to.
const licenses: ILicense[] = await getProjectLicenses("./package.json");

For a full description of the library API and example usages please see the relevant docs page.

Advanced Configuration

Advanced configuration of the generated output can be done using a configuration file. In addition to the basic CLI arguments, a configuration file allows you to specify appendices, exclusions, and replacements.

Config files can be called either .glf or .generatelicensefile and can be customised using the following options:

  • File name can optionally end with rc
  • Can be in a ./.config directory (no longer needs the . prefix on the file name)
  • Have the following file extensions: .json, jsonc, .json5, .yaml, .yml, .js, .cjs

E.g. .glf.json, .glfrc.yml, .generatelicensefile.jsonc, .config/glf.js, and more.

{
  // Default config - can be passed in via config and/or CLI
  "inputs": ["./package.json"],
  "output": "./third-party-licenses.txt",
  "lineEnding": "lf",

  // Paths to any file's whose content will be appended to the end of the generated file.
  "append": ["./additional-content.txt"],

  // Substitute the given packages license with the content in the respective file.
  "replace": {
    "[email protected]": "./bespoke-license.txt",
    "another-replaced-package": "./bespoke-license-2.txt"
  },

  // Exclude any packages from the output.
  "exclude": ["[email protected]"]
}

If you want to call your config file something else then you can pass it to the CLI via the --config argument:

$ npx generate-license-file --config ./my-config.json

License

generate-license-file is licensed under the ISC License.

generate-license-file's People

Contributors

bluegreenmagick avatar dependabot[bot] avatar pogodaanton avatar renovate-bot avatar renovate[bot] avatar tobybessant avatar tobysmith568 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

generate-license-file's Issues

Option to include dev dependencies

It would be nice to have an option which would also include the development dependencies. The package does only include the runtime dependencies and doesn't have an option to change that behavior.

Writing only the package name when using the replace option

https://generate-license-file.js.org/docs/cli/config-file#replace

For the replace option, is it possible to write only the name of the package, without including the version?

Current:

module.exports = {
  replace: {
    "[email protected]": "./licenses/lodash.txt",
    "[email protected]": "./node_modules/react/LICENSE",
  },
};

Suggestion:

module.exports = {
  replace: {
    "lodash": "./licenses/lodash.txt",
    "react": "./node_modules/react/LICENSE",
  },
};

Option to only include dependencies; exclude devDependencies

Hello, This is very useful project!

I wonder if including any other dependency in generated license file should include devDependencies or other types of dependencies listed in https://docs.npmjs.com/cli/v9/configuring-npm/package-json.

My understanding is that final build output distributed would not include devDependencies ?

I was not able to disable licenses of devDependencies in generated file using current cli. It would be nice to have cli option to not include devDependencies. Also wondering if there are workaround in existing cli to do so?

Thank you

Programmatic use =>Many errors

Hi,
If I want to use the "Programmatic use" way, i get the following errors:
Could you please help me to solve the problem?

Warning: ./node_modules/minimatch/minimatch.js
Module not found: Error: Can't resolve 'path' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\minimatch'

Warning: C:\DEV\Grund_DevOpsGlobal\angular\src\AppPreBootstrap.ts depends on 'lodash'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: C:\DEV\Grund_DevOpsGlobal\angular\src\assets\metronic\app\core\directives\menu-aside.directive.ts depends on 'object-path'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: C:\DEV\Grund_DevOpsGlobal\angular\src\app\main\main.module.ts depends on 'angular2-counto'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: C:\DEV\Grund_DevOpsGlobal\angular\src\app\admin\admin.module.ts depends on 'angular2-text-mask'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Error: ./node_modules/graceful-fs/polyfills.js
Module not found: Error: Can't resolve 'constants' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\graceful-fs'

Error: ./node_modules/fs.realpath/index.js
Module not found: Error: Can't resolve 'fs' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\fs.realpath'

Error: ./node_modules/fs.realpath/old.js
Module not found: Error: Can't resolve 'fs' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\fs.realpath'

Error: ./node_modules/generate-license-file/dist/utils/file.utils.js
Module not found: Error: Can't resolve 'fs' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\generate-license-file\dist\utils'

Error: ./node_modules/glob/glob.js
Module not found: Error: Can't resolve 'fs' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\glob'

Error: ./node_modules/glob/sync.js
Module not found: Error: Can't resolve 'fs' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\glob'

Error: ./node_modules/graceful-fs/graceful-fs.js
Module not found: Error: Can't resolve 'fs' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\graceful-fs'

Error: ./node_modules/license-checker/lib/index.js
Module not found: Error: Can't resolve 'fs' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\license-checker\lib'

Error: ./node_modules/license-checker/node_modules/mkdirp/index.js
Module not found: Error: Can't resolve 'fs' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\license-checker\node_modules\mkdirp'

Error: ./node_modules/read-installed/read-installed.js
Module not found: Error: Can't resolve 'fs' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\read-installed'

Error: ./node_modules/read-package-json/read-json.js
Module not found: Error: Can't resolve 'fs' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\read-package-json'

Error: ./node_modules/resolve/lib/async.js
Module not found: Error: Can't resolve 'fs' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\resolve\lib'

Error: ./node_modules/resolve/lib/sync.js
Module not found: Error: Can't resolve 'fs' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\resolve\lib'

Error: ./node_modules/generate-license-file/dist/main.js
Module not found: Error: Can't resolve 'os' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\generate-license-file\dist'

Error: ./node_modules/fs.realpath/old.js
Module not found: Error: Can't resolve 'path' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\fs.realpath'

Error: ./node_modules/glob/glob.js
Module not found: Error: Can't resolve 'path' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\glob'

Error: ./node_modules/glob/common.js
Module not found: Error: Can't resolve 'path' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\glob'

Error: ./node_modules/glob/sync.js
1mModule not found: Error: Can't resolve 'path' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\glob'

Error: ./node_modules/license-checker/lib/index.js
Module not found: Error: Can't resolve 'path' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\license-checker\lib'

Error: ./node_modules/license-checker/lib/license-files.js
Module not found: Error: Can't resolve 'path' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\license-checker\lib'

Error: ./node_modules/license-checker/node_modules/mkdirp/index.js
Module not found: Error: Can't resolve 'path' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\license-checker\node_modules\mkdirp'

Error: ./node_modules/npm-normalize-package-bin/index.js
Module not found: Error: Can't resolve 'path' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\npm-normalize-package-bin'

Error: ./node_modules/read-installed/read-installed.js
Module not found: Error: Can't resolve 'path' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\read-installed'

Error: ./node_modules/read-package-json/read-json.js
Module not found: Error: Can't resolve 'path' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\read-package-json'

Error: ./node_modules/readdir-scoped-modules/readdir.js
Module not found: Error: Can't resolve 'path' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\readdir-scoped-modules'

Error: ./node_modules/resolve/lib/async.js
Module not found: Error: Can't resolve 'path' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\resolve\lib'

Error: ./node_modules/resolve/lib/sync.js
Module not found: Error: Can't resolve 'path' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\resolve\lib'

Error: ./node_modules/resolve/lib/node-modules-paths.js
Module not found: Error: Can't resolve 'path' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\resolve\lib'

Error: ./node_modules/spdx-expression-parse/scan.js
Module not found: Error: Can't resolve 'spdx-exceptions' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\spdx-expression-parse'

Error: ./node_modules/spdx-correct/index.js
Module not found: Error: Can't resolve 'spdx-license-ids' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\spdx-correct'

Error: ./node_modules/spdx-expression-parse/scan.js
Module not found: Error: Can't resolve 'spdx-license-ids' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\spdx-expression-parse'

Error: ./node_modules/spdx-expression-parse/scan.js
Module not found: Error: Can't resolve 'spdx-license-ids/deprecated' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\spdx-expression-parse'

Error: ./node_modules/spdx-compare/index.js
Module not found: Error: Can't resolve 'spdx-ranges' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\spdx-compare'

Error: ./node_modules/spdx-satisfies/index.js
Module not found: Error: Can't resolve 'spdx-ranges' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\spdx-satisfies'

Error: ./node_modules/graceful-fs/legacy-streams.js
Module not found: Error: Can't resolve 'stream' in 'C:\DEV\Grund_DevOpsGlobal\angular\node_modules\graceful-fs'

** Angular Live Development Server is listening on 0.0.0.0:4200, open your browser on http://localhost:4200/ **

Error from chokidar (C:): Error: EBUSY: resource busy or locked, lstat 'C:\hiberfil.sys'
Error from chokidar (C:\node_modules): Error: EBUSY: resource busy or locked, lstat 'C:\hiberfil.sys'

Messy license notice in some instances

What happens currently?
The CLI regards the package's README as the license file in some instances. Due to this the generated file contains the wrong license notice for that project.

Example image

What should happen?
Since every package.json needs to have a license field, using that as a fallback is possible. However, the CLI could also retrieve generic licenses through some API of sorts.

--config command does not work

How can I use the beta config options?

$ npx generate-license-file --config .glf.json
โœ– unknown or unexpected option: --config

It's not listed on the docs page, but is on the Github README. According to the docs it should just pick up the file automatically if it's not a custom name, but that doesn't appear to work either. Additionally, the docs say that --input or --output are required, otherwise there will be a prompt, but if there's a config file then the prompt shouldn't happen.

Inconsistent inclusion of peerDependencies

Hello! I'm in the process of migrating from v2 to v3 for the package. But I'm seeing dependencies listed under both devDependencies and peerDependencies doesn't get included in the generated third party license file for V3. Here's an example of a package.json where react is a PeerDep but it's also in devDep for testing and other development usage within the app (e.g. packages like react-redux have this structure):

{
  "name": "test",
  "version": "0.1.0",
  "description": "Test",
  "scripts": {
    "test": "generate-license-file --input package.json --output THIRD-PARTY-NOTICES --overwrite"
  },
  "devDependencies": {
    "generate-license-file": "^3.0.0",
    "react": "^18.2.0"
  },
  "peerDependencies": {
    "lodash.isequal": "^4.5.0",
    "react": "^18.2.0"
  }
}

lodash.isEqual would be listed but not react. I'm not sure if that's intentional but I would expect any dependencies listed under peerDependencies should be included regardless if it's also in devDep.

Thank you for your time

Update dependencies to latest where possible

npm outdated lists following:

Package                           Current   Wanted   Latest  Location
@types/glob                         7.1.4    7.2.0    7.2.0  generate-license-file
@types/inquirer                     6.5.0    6.5.0    8.1.3  generate-license-file
@types/jest                        27.0.1   27.0.3   27.0.3  generate-license-file
@types/node                        16.7.1  16.11.9  16.11.9  generate-license-file
arg                                 4.1.3    4.1.3    5.0.1  generate-license-file
cli-spinners                        2.6.0    2.6.1    2.6.1  generate-license-file
del-cli                             3.0.1    3.0.1    4.0.1  generate-license-file
glob                                7.1.7    7.2.0    7.2.0  generate-license-file
inquirer                            7.3.3    7.3.3    8.2.0  generate-license-file
jest                               27.0.6   27.3.1   27.3.1  generate-license-file
ora                                 4.1.1    4.1.1    6.0.1  generate-license-file
prettier                            2.3.2    2.4.1    2.4.1  generate-license-file
prettier-plugin-organize-imports    2.3.3    2.3.4    2.3.4  generate-license-file
ts-jest                            27.0.5   27.0.7   27.0.7  generate-license-file
typescript                          4.3.5    4.5.2    4.5.2  generate-license-file

Especially ansi-regex should be updated because of the dependency of ansi-regex.

Notice prefix in plural when a single package is addressed

What happens currently?
The introducing paragraph is always written in plural form, even though some package lists contain a single item.

What should happen?
The prefix should be phrased in singular form if the addressed list only contains a single item.

- The following NPM packages may be included in this product:
+ The following NPM package may be included in this product:

 - [email protected]

- These packages each contain the following license and notice below:
+ This package contains the following license and notice below:

Error when importing the result of getProjectLicenses in a component [ANGULAR]

I am trying to use this package in an Angular v14 project, for this, I have created a typescript utils file like the following:

import { getProjectLicenses } from 'generate-license-file';
import { ILicense } from 'generate-license-file/dist/models/license';
import { Observable } from 'rxjs';
import { fromPromise } from 'rxjs/internal-compatibility';

export const licenses: Observable<ILicense[]> = fromPromise(getProjectLicenses('../../../../../../../package.json'));

And then, within my component I am importing it and trying to use like this:

import { licenses } from '@shared/utils/abm/licenses-generator.utils';

@Component({...})
export class AppComponent implements OnInit {
    ngOnInit(): void {
       const myLicenses = licenses;
    }
}

With only the code shown in the component, once I saved, I get the following errors:

Compiled with problems:X

ERROR in ./node_modules/fs.realpath/index.js 8:9-22

Module not found: Error: Can't resolve 'fs' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/fs.realpath'


ERROR in ./node_modules/fs.realpath/old.js 25:9-22

Module not found: Error: Can't resolve 'fs' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/fs.realpath'


ERROR in ./node_modules/generate-license-file/dist/getLicenseFileText.js 72:24-37

Module not found: Error: Can't resolve 'os' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/generate-license-file/dist'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "os": require.resolve("os-browserify/browser") }'
	- install 'os-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "os": false }


ERROR in ./node_modules/generate-license-file/dist/utils/file.utils.js 72:24-37

Module not found: Error: Can't resolve 'fs' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/generate-license-file/dist/utils'


ERROR in ./node_modules/graceful-fs/graceful-fs.js 1:9-22

Module not found: Error: Can't resolve 'fs' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/graceful-fs'


ERROR in ./node_modules/graceful-fs/graceful-fs.js 86:6-29

Module not found: Error: Can't resolve 'assert' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/graceful-fs'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "assert": require.resolve("assert/") }'
	- install 'assert'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "assert": false }


ERROR in ./node_modules/graceful-fs/legacy-streams.js 1:13-37

Module not found: Error: Can't resolve 'stream' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/graceful-fs'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
	- install 'stream-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "stream": false }


ERROR in ./node_modules/graceful-fs/polyfills.js 1:16-36

Module not found: Error: Can't resolve 'constants' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/graceful-fs'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "constants": require.resolve("constants-browserify") }'
	- install 'constants-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "constants": false }


ERROR in ./node_modules/license-checker/lib/index.js 9:9-22

Module not found: Error: Can't resolve 'fs' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/license-checker/lib'


ERROR in ./node_modules/license-checker/node_modules/mkdirp/index.js 3:9-22

Module not found: Error: Can't resolve 'fs' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/license-checker/node_modules/mkdirp'


ERROR in ./node_modules/read-installed/node_modules/glob/common.js 13:9-22

Module not found: Error: Can't resolve 'fs' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/read-installed/node_modules/glob'


ERROR in ./node_modules/read-installed/node_modules/glob/glob.js 54:13-30

Module not found: Error: Can't resolve 'assert' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/read-installed/node_modules/glob'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "assert": require.resolve("assert/") }'
	- install 'assert'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "assert": false }


ERROR in ./node_modules/read-installed/node_modules/glob/sync.js 16:13-30

Module not found: Error: Can't resolve 'assert' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/read-installed/node_modules/glob'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "assert": require.resolve("assert/") }'
	- install 'assert'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "assert": false }


ERROR in ./node_modules/read-installed/node_modules/hosted-git-info/index.js 3:10-24

Module not found: Error: Can't resolve 'url' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/read-installed/node_modules/hosted-git-info'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "url": require.resolve("url/") }'
	- install 'url'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "url": false }


ERROR in ./node_modules/read-installed/node_modules/normalize-package-data/lib/fixer.js 13:10-24

Module not found: Error: Can't resolve 'url' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/read-installed/node_modules/normalize-package-data/lib'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "url": require.resolve("url/") }'
	- install 'url'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "url": false }


ERROR in ./node_modules/read-installed/node_modules/read-package-json/read-json.js 1:9-22

Module not found: Error: Can't resolve 'fs' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/read-installed/node_modules/read-package-json'


ERROR in ./node_modules/read-installed/read-installed.js 91:11-24

Module not found: Error: Can't resolve 'fs' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/read-installed'


ERROR in ./node_modules/read-installed/read-installed.js 102:10-24

Module not found: Error: Can't resolve 'url' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/read-installed'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "url": require.resolve("url/") }'
	- install 'url'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "url": false }


ERROR in ./node_modules/resolve/lib/async.js 1:9-22

Module not found: Error: Can't resolve 'fs' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/resolve/lib'


ERROR in ./node_modules/resolve/lib/homedir.js 3:9-22

Module not found: Error: Can't resolve 'os' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/resolve/lib'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "os": require.resolve("os-browserify/browser") }'
	- install 'os-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "os": false }


ERROR in ./node_modules/resolve/lib/sync.js 3:9-22

Module not found: Error: Can't resolve 'fs' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/resolve/lib'


ERROR in ./node_modules/spdx-compare/index.js 5:13-35

Module not found: Error: Can't resolve 'spdx-ranges' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/spdx-compare'


ERROR in ./node_modules/spdx-correct/index.js 18:21-48

Module not found: Error: Can't resolve 'spdx-license-ids' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/spdx-correct'


ERROR in ./node_modules/spdx-expression-parse/scan.js 3:25-52

Module not found: Error: Can't resolve 'spdx-license-ids' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/spdx-expression-parse'


ERROR in ./node_modules/spdx-expression-parse/scan.js 3:61-99

Module not found: Error: Can't resolve 'spdx-license-ids/deprecated' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/spdx-expression-parse'


ERROR in ./node_modules/spdx-expression-parse/scan.js 5:17-43

Module not found: Error: Can't resolve 'spdx-exceptions' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/spdx-expression-parse'


ERROR in ./node_modules/spdx-satisfies/index.js 5:13-35

Module not found: Error: Can't resolve 'spdx-ranges' in '/Users/andresalban/Documents/ABM/software/frontends/node_modules/spdx-satisfies'

I tried running npm i again but no luck...
I also tried using without fromPromise and just await ... but I get this error

Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.

I made the changes in my tsconfig.json and still I got the above error message:

compilerOptions: {
    .....
    "target": "es2017",
    "module": "es2022",
}

feature request: exclude current repo's license

Hello,
I have been using generate-license-file library to create third-party notices file for dependencies from repo's package.json and noticed that the generated file also include the repo's own license. Is it possible to add a feature flag to the CLI to not include your current package's license? Or potentially export things like the License class and/or format functions and variables from the library to assist this use case?
Thank you for your time!

Illegal operation on a directory

Hi,
In Angular whenever i try to create the license file in sub folder (here src)
>generate-license-file --input package.json --output src 3rd-party-licenses.txt
I got this error.
Error: EISDIR: illegal operation on a directory, open 'C:\DEV\DAC6\angular\src'
Emitted 'error' event on WriteStream instance at:
at emitErrorNT (node:internal/streams/destroy:193:8)
at emitErrorCloseNT (node:internal/streams/destroy:158:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -4068,
code: 'EISDIR',
syscall: 'open',
path: 'C:\DEV\DAC6\angular\src'
}
It works only if i create the file in same folder (not set the path)
generate-license-file --input package.json --output 3rd-party-licenses.txt

Any help appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.