Loopback-next: `npm start` failing on newly created lb4 app

Created on 9 Jun 2018  路  8Comments  路  Source: strongloop/loopback-next

Description / Steps to reproduce / Feature proposal

The app created following getting started guide is not in working state.

Current Behavior

Geting below exception when running npm start.

> lb-tsc

node_modules/@loopback/core/dist8/src/keys.d.ts:23:40 - error TS2307: Cannot find module '../../context/src/value-promise'.

23     const CONTROLLER_CLASS: BindingKey<import("../../context/src/value-promise").Constructor<any>>;
                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


node_modules/@loopback/repository-json-schema/dist8/src/keys.d.ts:6:68 - error TS2307: Cannot find module '../../metadata/src/types'.

6 export declare const JSON_SCHEMA_KEY: MetadataAccessor<JSONSchema, import("../../metadata/src/types").DecoratorType>;

Expected Behavior

App should run without any issue

Most helpful comment

Considering that Node.js 8.x LTS is at 8.11.3 now and 8.3.0 was released almost a year ago (2017-08-09) before 8.x entered LTS, I think it's acceptable to require our users to use 8.3.0 or newer.

I am proposing to update our docs and mention 8.9.0 as the minimum required version (8.9.0 was the first 8.x version covered by LTS). As part of this change, we should also update all of our package.json files and modify engines section to use >=8.9 instead of current >=8 version spec for Node.

All 8 comments

Hmm, it seems to be an issue related to TypeScript 2.9 (https://blogs.msdn.microsoft.com/typescript/2018/05/31/announcing-typescript-2-9/#import-types).

Running npm run build for loopback-next/packages/context produces an invalid key.d.ts from src/key.ts:

...
const CONTROLLER_CLASS: BindingKey<import("../../context/src/value-promise").Constructor<any>>;

Please note the relative import is invalid outside the monorepo.

Please try npm i -g @loopback/[email protected]

Thanks @raymondfeng

@loopback/[email protected] looks fine.

Its failing again on @loopback/[email protected] but with a different error now:

screen shot 2018-07-26 at 11 54 02

Okay, just found out that it fails with node v8.2.1 but with node v8.3.0 it does work. Maybe the docs should actually refer that the minimum node version is 8.3.0?

I've been able to reproduce the problem.

I see two options:

  • update our docs to have 8.3 and above
  • replace object spread operators with Object.assign

What do you think @strongloop/sq-lb-apex, @bajtos, @raymondfeng?

Considering that Node.js 8.x LTS is at 8.11.3 now and 8.3.0 was released almost a year ago (2017-08-09) before 8.x entered LTS, I think it's acceptable to require our users to use 8.3.0 or newer.

I am proposing to update our docs and mention 8.9.0 as the minimum required version (8.9.0 was the first 8.x version covered by LTS). As part of this change, we should also update all of our package.json files and modify engines section to use >=8.9 instead of current >=8 version spec for Node.

Was this page helpful?
0 / 5 - 0 ratings