nestjs/serve-static

Module '"@nestjs/serve-static"' has no exported member 'ServeStaticModule'.

bussiere opened this issue · 1 comments

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

'''
2 import { ServeStaticModule } from '@nestjs/serve-static';

'''

src/app.module.ts:2:10 - error TS2305: Module '"@nestjs/serve-static"' has no exported member 'ServeStaticModule

https://i.imgur.com/YP4gMrS.png

It seems that the static module have a problem.

Minimum reproduction code

https://gist.github.com/bussiere/c1ed49fdb9edb9eda64eebb5b9052878

Steps to reproduce

npm install @nestjs/serve-static

and use
'''
import { ServeStaticModule } from '@nestjs/serve-static';
'''

Expected behavior

that ServeStaticModule can be imported.

Package version

github:nestjs/serve-static

NestJS version

8.2.2

Node.js version

v17.5.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

install @nestjs/serve-static instead of github:nestjs/serve-static

Just run:

npm uninstall @nestjs/serve-static && npm install @nestjs/serve-static

you probably have ran npm install nestjs/serve-static before, so you end up installing the github version (which doesn't ships the compiled code)