Closed dinana closed 6 years ago
In order to be able to run start:prod I needed to move @types/node from devDependencies to dependencies otherwise I got the following error:
start:prod
@types/node
devDependencies
dependencies
> dyndns@0.0.1 prestart:prod /usr/src/app > rm -rf dist && tsc node_modules/@nestjs/common/interfaces/external/mqtt-options.interface.d.ts(1,23): error TS2688: Cannot find type definition file for 'node'. node_modules/@nestjs/common/interfaces/external/mqtt-options.interface.d.ts(96,31): error TS2304: Cannot find name 'Buffer'. node_modules/@nestjs/common/interfaces/external/mqtt-options.interface.d.ts(96,40): error TS2304: Cannot find name 'Buffer'. node_modules/@nestjs/common/interfaces/external/mqtt-options.interface.d.ts(100,32): error TS2304: Cannot find name 'Buffer'. node_modules/@nestjs/common/interfaces/external/mqtt-options.interface.d.ts(100,41): error TS2304: Cannot find name 'Buffer'. node_modules/@nestjs/common/interfaces/external/mqtt-options.interface.d.ts(104,30): error TS2304: Cannot find name 'Buffer'. node_modules/@nestjs/common/interfaces/external/mqtt-options.interface.d.ts(104,39): error TS2304: Cannot find name 'Buffer'. node_modules/@nestjs/common/interfaces/external/multer-options.interface.d.ts(1,23): error TS2688: Cannot find type definition file for 'node'. node_modules/@nestjs/common/interfaces/external/multer-options.interface.d.ts(49,17): error TS2304: Cannot find name 'Buffer'. node_modules/@nestjs/common/interfaces/http/http-server.interface.d.ts(1,23): error TS2688: Cannot find type definition file for 'node'. node_modules/@nestjs/common/interfaces/http/http-server.interface.d.ts(2,49): error TS2307: Cannot find module 'http'. node_modules/@nestjs/common/interfaces/nest-fastify-application.interface.d.ts(1,23): error TS2688: Cannot find type definition file for 'node'. node_modules/@nestjs/common/interfaces/nest-fastify-application.interface.d.ts(45,33): error TS2304: Cannot find name 'Buffer'. node_modules/@nestjs/common/interfaces/nest-fastify-application.interface.d.ts(63,17): error TS2304: Cannot find name 'Buffer'. node_modules/@nestjs/core/nest-application.d.ts(1,23): error TS2688: Cannot find type definition file for 'node'. node_modules/@nestjs/core/nest-application.d.ts(10,23): error TS2307: Cannot find module 'http'. npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! project@0.0.1 prestart:prod: `rm -rf dist && tsc` npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the project@0.0.1 prestart:prod script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Fixed 🙂
How was this fixed?
I found this commit - https://github.com/nestjs/typescript-starter/commit/176d945f28aca09cfdc63998a5b3ec9e8e538d9f
In order to be able to run
start:prod
I needed to move@types/node
fromdevDependencies
todependencies
otherwise I got the following error: