Я намагаюся зрозуміти typscript і angular2, дотримуючись https://angular.io/guide/quickstart.
Я пройшов різні кроки, але останній крок npm start
призведе до таких помилок
Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.
J:workspaceepimsstypescriptangular2-quickstart>npm start
> angular2-quickstart@1.0.0 start J:workspaceepimsstypescriptangular2-quickstart
> concurrently "npm run tsc:w" "npm run lite"
[0]
[0] > angular2-quickstart@1.0.0 tsc:w J:workspaceepimsstypescriptangular2-quickstart
[0] > tsc -w
[0]
[1]
[1] > angular2-quickstart@1.0.0 lite J:workspaceepimsstypescriptangular2-quickstart
[1] > lite-server
[1]
[0] 7:51:31 PM - Compilation complete. Watching for file changes.
[1] Did not detect a `bs-config.json` or `bs-config.js` override file. Using lite-server defaults...
[1] ** browser-sync options **
[1] { injectChanges: false,
[1] files: [ "./**/*.{html,htm,css,js}" ],
[1] server: { baseDir: "./", middleware: [ [Function], [Function] ] } }
[1] [BS] Access URLs:
[1] ------------------------------------
[1] Local: http://localhost:3000
[1] External: http://192.168.2.4:3000
[1] ------------------------------------
[1] UI: http://localhost:3001
[1] UI External: http://192.168.2.4:3001
[1] ------------------------------------
[1] [BS] Serving files from: ./
[1] [BS] Watching files...
[1] 16.03.09 19:51:36 404 GET /index.html
[1] 16.03.09 19:51:37 404 GET /favicon.ico
[1] 16.03.09 19:51:38 404 GET /favicon.ico
Хто-небудь має подібний досвід?
Дякую
Відповіді:
3 для відповіді № 1Після того, як ви закінчите навчання, ви отримаєте структуру папок, як на малюнку нижче, тепер для Lite-сервера для обслуговування додаток і node_modules папки потрібно додати bs-config.json файл у папці angular2-quickstart.
{
"port": 3000,
"files": ["/app/**/*.{html,htm,css,js}"],
"server": { "baseDir": ["./app"],
"routes": {
"/node_modules": "node_modules" , "/app": "app", "/app.component": "app"
}
}
}
1 для відповіді № 2
[1] [BS] Serving files from: ./
Слідує
[1] 16.03.09 19:51:36 404 GET /index.html
[1] 16.03.09 19:51:37 404 GET /favicon.ico
Просто означає, що ці файли (index.html
, favicon.ico
) не знаходяться в цьому місці (./
)
Потрібно буде перейти до місця, де містяться ці файли, або перемістити ці файли до місцезнаходження, яке ви переглядаєте.