Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The fixing way for running issue: 'npm start' this repo #77

Open
HaolunWang opened this issue Apr 4, 2022 · 4 comments
Open

The fixing way for running issue: 'npm start' this repo #77

HaolunWang opened this issue Apr 4, 2022 · 4 comments

Comments

@HaolunWang
Copy link

HaolunWang commented Apr 4, 2022

I got to know how to fix the 'Invalid 'reference' directive syntax' issue after you cloned the repo, did 'npm install', and did 'npm start'.

The solution is to update the package.json, update the typescript version:

package.json:
"devDependencies": {
"typescript": "^4.6.3"
}

So, update the typescript version to the latest one (the current latest version is 4.6.3).

@HaolunWang HaolunWang changed the title The issue to 'npm start' this repo The fixing way for running issue: 'npm start' this repo Apr 4, 2022
@LayZeeDK
Copy link

TypeScript 4.6 is incompatible with older versions of Angular such as the one used in this repository. See https://gist.github.com/LayZeeDK/c822cc812f75bb07b7c55d07ba2719b3.

@LayZeeDK
Copy link

Also, only use this starter repo for Angular v4 or v5. Library projects have been built in to Angular CLI since version 6 if I recall correctly.

@HaolunWang
Copy link
Author

Also, only use this starter repo for Angular v4 or v5. Library projects have been built in to Angular CLI since version 6 if I recall correctly.

But when you do "npm start" in this repo, it doesn't work for some reason. How to fix it? If you can't change the version of TypeScript in package.json

@LayZeeDK
Copy link

LayZeeDK commented Apr 26, 2022

Use:

  • Node.js 6.17.1
  • npm 3.10.10

(I prefer Volta to manage Node.js versions)

Then modify package.json#devDependencies:

"@types/node": "~6.0.46",
"browser-sync": "~2.12.12",
"lite-server": "~2.2.2",

Finally:

npm install
npm start

Outcome:
Your browser opens http://localhost:3000 and renders:

<demo-app ng-version="4.1.3">
  <my-lib _nghost-c0="">
    <h2 _ngcontent-c0="">Hello Angular Library</h2>
  </my-lib>
  <h3>Meaning is: 42</h3>
</demo-app>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants