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

error TS1452: 'resolution-mode' assertions are only supported when moduleResolution is node16 or nodenext. #2151

Closed
2 tasks done
sawa-ko opened this issue Sep 21, 2022 · 2 comments

Comments

@sawa-ko
Copy link

sawa-ko commented Sep 21, 2022

Describe the bug

  • Node.js version: v18.6.0
  • OS & version: Windows 11

Actual behavior

node_modules/cacheable-request/dist/types.d.ts:1:23 - error TS1452: 'resolution-mode' assertions are only supported when moduleResolution is node16 or nodenext.

Expected behavior

No error

Typescript config

{
	"compileOnSave": true,
	"compilerOptions": {
		"allowSyntheticDefaultImports": true,
		"alwaysStrict": true,
		"declaration": true,
		"declarationMap": true,
		"emitDecoratorMetadata": true,
		"esModuleInterop": true,
		"experimentalDecorators": true,
		"forceConsistentCasingInFileNames": true,
		"importHelpers": true,
		"importsNotUsedAsValues": "error",
		"incremental": true,
		"lib": ["esnext"],
		"module": "ESNext"
		"moduleResolution": "Node",
		"newLine": "lf",
		"noEmitHelpers": true,
		"noFallthroughCasesInSwitch": true,
		"noImplicitReturns": true,
		"noUnusedLocals": true,
		"noUnusedParameters": true,
		"preserveConstEnums": true,
		"pretty": true,
		"removeComments": false,
		"resolveJsonModule": true,
		"sourceMap": true,
		"strict": true,
		"target": "ES2020",
		"useDefineForClassFields": true
	}
}

Checklist

  • I have read the documentation.
  • I have tried my code with the latest version of Node.js and Got.
@sindresorhus
Copy link
Owner

See: #2051 (comment)

@mysoly
Copy link

mysoly commented Oct 12, 2022

You can remove resolution-mode="require" part from your code (like <reference types="node" resolution-mode="require"/>)

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

3 participants