Moh*_*man 9 node.js npm typescript lite-server angular
我正在学习angularjs 2.我想从他们的官方网站在angularjs 2中首次申请.所以我从这里跟随所有人https://angular.io/guide/quickstart.现在在步骤6中我必须在终端中运行命令'npm start'.它给我的结果像终端一样 -
$ npm start
> angular-quickstart@1.0.0 start D:\Sadiq\Res\Angularjs__2\angularQ
> tsc && concurrently "tsc -w" "lite-server"
[1] Did not detect a `bs-config.json` or `bs-config.js` override file. Using lite-server defaults...
[1] ** browser-sync config **
[1] { injectChanges: false,
[1] files: [ './**/*.{html,htm,css,js}' ],
[1] watchOptions: { ignored: 'node_modules' },
[1] server: { baseDir: './', middleware: [ [Function], [Function] ] } }
[1] [BS] Access URLs:
[1] -------------------------------------
[1] Local: http://localhost:3002
[1] External: http://192.168.2.93:3002
[1] -------------------------------------
[1] UI: http://localhost:3003
[1] UI External: http://192.168.2.93:3003
[1] -------------------------------------
[1] [BS] Serving files from: ./
[1] [BS] Watching files...
[1] [BS] File changed: app\app.component.js
[1] [BS] File changed: app\app.module.js
[1] [BS] File changed: app\main.js
[0] 12:01:51 PM - Compilation complete. Watching for file changes.
Run Code Online (Sandbox Code Playgroud)
但它没有在我的crome中打开任何标签.如果我输入它提供的网址
在地址栏中手动提供预期的结果,工作正常,源文件中的任何更改都会立即导致浏览器更改.问题是:我无法弄清楚为什么它不能自动打开浏览器中的标签. 谁能帮我?
更新2016年11月7日
重要的观察是我将我的项目复制到另外两台电脑中.在那里它按预期工作.当我运行'npm start'时,它在浏览器中打开选项卡并运行应用程序.所以它创建没有问题,并根据官方angular2教程site.can任何人都知道为什么这发生在我的电脑还是我的浏览器?
一切看起来都很好,唯一的原因可能是你的配置中有 open:false 。你能试试这个吗
在根目录创建一个文件 bs-config.js 并添加以下代码,
module.exports = {
port: 5000,//custom port
files: ['./**/*.{html,htm,css,js}'],
open: true
};
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4257 次 |
| 最近记录: |