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

npm i produces error "type-check is deprecated" and "Type 'string' cannot be used to index type 'ExportType'." #140

Open
netpoetica opened this issue Nov 1, 2020 · 0 comments

Comments

@netpoetica
Copy link

netpoetica commented Nov 1, 2020

After cloning, while npm installling, nbinid will produce the following errors with the following node/npm versions:

➜  nbind git:(master) ✗ node -v
v12.18.4
➜  nbind git:(master) ✗ npm -v
6.14.6
➜  nbind git:(master) npm i
....
> nbind@0.3.15 lint /Users/rosenbek/github/nbind
> node src/checkver.js lt 10.0.0 || (tslint --type-check -c src/tslint.json -p src/tsconfig.json && tslint --type-check -c src/tslint.json -p src/em/tsconfig.json)

--type-check is deprecated. You only need --project to enable rules which need type information.
Error at src/nbind.ts:329:3: Type 'string' cannot be used to index type 'ExportType'.

I removed the --type-check flags from the package.json, which got me further, but then I get a new error:

➜  nbind git:(master) ✗ npm i 
...

> nbind@0.3.15 lint /Users/rosenbek/github/nbind
> node src/checkver.js lt 10.0.0 || (tslint -c src/tslint.json -p src/tsconfig.json && tslint -c src/tslint.json -p src/em/tsconfig.json)

src/nbind.ts:329:3 - error TS2536: Type 'string' cannot be used to index type 'ExportType'.

329  	binding.lib[key] = lib[key];
     	~~~~~~~~~~~~~~~~


Found 1 error.

Which seems to come from this code:

	Object.keys(lib).forEach(function(key: string) {
		binding.lib[key] = lib[key];
	});

because key is a string, but binding.lib is expecting this ExportType object. I did try to fix this and hope to put together a PR, but I am a bit too new to nbind I think to produce a valid solution.

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

1 participant