我正在尝试安装this github sample Angular2 app written in JavaScript ,但应用程序无法在浏览器中引导。我在下面添加了一个打印屏幕,显示 FireFox 控制台报告它无法找到 boot.css
。 为了成功启动示例应用程序,我需要执行哪些具体步骤或更改?
按照上面链接中的说明,我在 CentOS 7 终端中输入以下内容:
git clone https://github.com/blacksonic/angular2-esnext-starter.git
cd angular2-esnext-starter
npm install
gulp serve
终端随后打印以下内容:
[user@localhost angular2-esnext-starter]$ gulp serve
[14:50:17] Using gulpfile ~/nodejs_apps/angular2-esnext-starter/gulpfile.js
[14:50:17] Starting 'serve'...
[14:50:17] Starting 'clean'...
[14:50:17] Finished 'clean' after 38 ms
[14:50:17] Starting 'client-build'...
[14:50:17] Starting 'client-copy'...
[14:50:17] Starting 'client-stylesheet'...
[14:50:17] Starting 'livereload'...
[14:50:17] Finished 'livereload' after 2.43 ms
[14:50:18] Finished 'client-stylesheet' after 808 ms
[14:50:19] Finished 'client-copy' after 1.61 s
[14:50:23] Finished 'client-build' after 5.94 s
[14:50:23] Starting 'server-start'...
[14:50:23] Finished 'server-start' after 1.36 ms
[14:50:23] Finished 'serve' after 5.98 s
[14:50:23] [nodemon] 1.9.2
[14:50:23] [nodemon] to restart at any time, enter `rs`
[14:50:23] [nodemon] watching: /home/user/nodejs_apps/angular2-esnext-starter/server/**/*
[14:50:23] [nodemon] starting `node server/index.js`
[14:50:24] [nodemon] Internal watch failed: watch /home/user/nodejs_apps/angular2-esnext-starter/server/config.js ENOSPC
然后我在浏览器中得到以下内容:
为了确认我至少安装了 Node.js 4+ 版本,我输入了以下内容,并得到了以下响应:
[user@localhost angular2-esnext-starter]$ node --version
v5.12.0
最佳答案
问题就在日志的末尾:ENOSPC
根据another question这可能是由于磁盘空间不足或耗尽进程可以监视的文件数量造成的。
在您的情况下,nodejs 进程可能已达到它可以监视的默认文件数。在 gulpfile.js
设置文件中,配置了 livereload
命令 - 它“监视”目录及其文件,并在发生更改时触发重新加载。尽管存储库中只有 83 个文件,但所有已安装的依赖项(在 package.json 文件中找到,通过 npm install
安装)可能会使其达到文件监视限制。
关于javascript - 为什么这个 Angular2 JavaScript 示例应用程序无法启动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38535864/