If you know how to fix the issue, make a pull request instead.
@types/express
package and had problems.Definitions by:
in index.d.ts
) so they can respond.If you do not mention the authors the issue will be ignored.
Environment:
package.json
Action to reproduce the error:
tsc
Error encountered:
node_modules/@types/express/index.d.ts(90,50): error TS2694: Namespace '"C:/Users/ttoussaint/path/to/my/project/node_modules/@types/express-serve-static-core/index"' has no exported member 'Params'.
node_modules/@types/express/index.d.ts(90,64): error TS2694: Namespace '"C:/Users/ttoussaint/path/to/my/project/node_modules/@types/express-serve-static-core/index"' has no exported member 'ParamsDictionary'.
node_modules/@types/express/index.d.ts(90,90): error TS2315: Type 'ErrorRequestHandler' is not generic.
node_modules/@types/express/index.d.ts(99,38): error TS2694: Namespace '"C:/Users/ttoussaint/path/to/my/project/node_modules/@types/express-serve-static-core/index"' has no exported member 'Params'.
node_modules/@types/express/index.d.ts(99,52): error TS2694: Namespace '"C:/Users/ttoussaint/path/to/my/project/node_modules/@types/express-serve-static-core/index"' has no exported member 'ParamsDictionary'.
node_modules/@types/express/index.d.ts(99,78): error TS2315: Type 'Request' is not generic.
node_modules/@types/express/index.d.ts(100,45): error TS2694: Namespace '"C:/Users/ttoussaint/path/to/my/project/node_modules/@types/express-serve-static-core/index"' has no exported member 'Params'.
node_modules/@types/express/index.d.ts(100,59): error TS2694: Namespace '"C:/Users/ttoussaint/path/to/my/project/node_modules/@types/express-serve-static-core/index"' has no exported member 'ParamsDictionary'.
node_modules/@types/express/index.d.ts(100,85): error TS2315: Type 'RequestHandler' is not generic.
What I tried that DID _NOT_ work:
rm -rf node_modules
+ npm i
What I tried that DID work:
In my package-lock.json
, I could see the following:
"@types/express-serve-static-core": {
"version": "4.16.2",
...
},
I added @types/express-serve-static-core@latest
to my project's dependencies:
package.json
"@types/express-serve-static-core": "^4.17.0"
So now the package-lock.json
looks like so:
"@types/express-serve-static-core": {
"version": "4.17.0",
...
},
I cannot make a PR since the package.json
file is not in this repository. This is still an issue, since @types/express-serve-static-core
should not appear amongst my dependencies.
thanks, @ttous s This fixed the same issue in my project.
Another approach is to remove all packages that depend on @types/express-serve-static-core
and then re-add them.
I wonder if this could be fixed by using a package.json
to reference @types/express-serve-static-core@^4.17.1
. I don't know enough about how definitely typed works but it appears it is generating a package.json with @types/express-serve-static-core@*
which is incorrect.
After a yarn add @types/express-serve-static-core@^4.17.1
(which has resolved to 4.17.2
) this still didn't work for me without nuking yarn.lock
and my node_modules/
directory.
After that things are fine, I just prefer not having a hard-coded transient dep in my tree.
Same problem here.
Same problem here with yarn
Me funcion贸 esto:
sudo rm -rf node_modules
sudo rm yarn.lock,
sudo yarn
Worked for me:
rm yarn.lock
yarn
yarn start:dev
BTW:
sudo rm -rf node_modules
sudo rm yarn.lock,
sudo yarn
There's no need for sudo in there
Most helpful comment
Same problem here.