Nest: Can't import Injectable from @nestjs/common

Created on 1 May 2018  路  4Comments  路  Source: nestjs/nest

I'm submitting a...


[ ] Regression 
[X] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

Injectable doesn't seem to be importable (following the passport authentication example):

[ts] Module '"/Users/me/Development/nest/node_modules/@nestjs/common/index"' has no exported member 'Injectable'.
import Injectable

Expected behavior

This should be importable

Minimal reproduction of the problem with instructions

Just try importing Injectable

import { Injectable } from '@nestjs/common';

What is the motivation / use case for changing the behavior?

Environment


Nest version: 4.6.6


For Tooling issues:
- Node version: XX  
v9.5.0
- Platform:  
macOS

Others:

Most helpful comment

You need to update Nest to v5, you are using Nest version: 4.6.6 and @Injectable was introduced in version 5.

All 4 comments

Also looks like nest crashes when starting up and @Injectable() is used:

@Injectable()
 ^
TypeError: common_1.Injectable is not a function

You need to update Nest to v5, you are using Nest version: 4.6.6 and @Injectable was introduced in version 5.

@shekohex +1

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cojack picture cojack  路  3Comments

mishelashala picture mishelashala  路  3Comments

cdiaz picture cdiaz  路  3Comments

yanshuf0 picture yanshuf0  路  3Comments

marshall007 picture marshall007  路  3Comments