Skip to content

Cannot npm start on getting-started #1817

Closed

Description

@pansitwattana

Description / Steps to reproduce / Feature proposal

error go like this closed issue #1557

Current Behavior

on @loopback/cli@0.29.0
-npm start => go error

but I tried to install 0.28.0
-npm start => work well

I think there is a problem with 0.29.0 that just released

node version 8.11.2

Activity

  1. mightytyphoon commented on Oct 6, 2018

    @mightytyphoon

    Hi, the problem come from the name of the dist folder. If you rename it for dist10 it works.

    As a quick fix, in package.json change the line :

    "build": "lb-tsc es2017 --outDir dist"

    to

    "build": "lb-tsc es2017 --outDir dist10" (also you can changees2017for es2018)

    EDIT 2 : you can also get rid of the --outDir, it should make your dist8 automatically.

    It comes from this package : @loopback/dist-util.

    EDIT :
    So yeah problem is managing dist folder name with the node version. For node version 8 (yours) you should use dist8. Last node version is 10.11.0, LTS version is 8.12.0. Maybe you have an output like this :

    Error: Cannot find module 'D:\Work\playground\loopback-test\test\dist10'
    ...
    

    Edit 3 : I think the problem comes from this : #1810

  2. mightytyphoon commented on Oct 6, 2018

    @mightytyphoon

    @pansitwattana thanks for your question, I was trying to implement a solution for live reloading and couldn't do it in a really clean way.

    So if you are interested you will need nodemon (npm i --save-dev nodemon or npm i -g nodemon)

    1. change the build:watch line to "build:watch": "lb-tsc es2018 --watch" by removing the --outDir you will not have problem with dist10/dist8 stuff.
    2. change the prestart line in package.json to "prestart": "start npm run build:watch" it will open a new cmd watching for file changes with lb-tsc (loopback typescript compiler)
    3. change the start line in package.json to "start": "nodemon --watch dist10" (or dist8 for node 8). It will restart node when dist folder is changed.
  3. mightytyphoon commented on Oct 6, 2018

    @mightytyphoon

    @pansitwattana fixed with version 0.30.0

  4. dhmlau commented on Oct 8, 2018

    @dhmlau
    Member

    @pansitwattana , i'd like to close this issue as resolved. If you still encounter this issue, feel free to ping us here or open a new issue. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions