问题:在执行命令npm start 是出现下列问题:

npm
[] WARN invalid config loglevel="notice"
[] npm WARN invalid config loglevel="notice"
[]
[] > angular-quickstart@1.0. build:watch /home/gjj/download/worksp/quickstart-master
[] > tsc -p src/ -w
[]
[]
[] > angular-quickstart@1.0. serve /home/gjj/download/worksp/quickstart-master
[] > lite-server -c=bs-config.json
[]
[] fs.js:
[] throw error;
[] ^
[]
[] Error: watch src ENOSPC
[] at exports._errnoException (util.js::)
[] at FSWatcher.start (fs.js::)
[] at Object.fs.watch (fs.js::)
[] at Object.watchDirectory (/home/gjj/download/worksp/quickstart-master/node_modules/_typescript@2.1.@typescript/lib/tsc.js::)
[] at Object.executeCommandLine (/home/gjj/download/worksp/quickstart-master/node_modules/_typescript@2.1.@typescript/lib/tsc.js::)
[] at Object.<anonymous> (/home/gjj/download/worksp/quickstart-master/node_modules/_typescript@2.1.@typescript/lib/tsc.js::)
[] at Module._compile (module.js::)
[] at Object.Module._extensions..js (module.js::)
[] at Module.load (module.js::)
[] at tryModuleLoad (module.js::)
[]
[] npm ERR!
[] Linux 4.10.--generic
[] npm ERR! argv "/usr/local/node/bin/node" "/usr/local/node/bin/npm" "run" "build:watch"
[] npm ERR! node v6.11.2
[] npm ERR! npm v3.10.10
[] npm ERR! code ELIFECYCLE
[] npm ERR! angular-quickstart@1.0. build:watch: `tsc -p src/ -w`
[] npm ERR! Exit status
[] npm ERR!
[] npm ERR! Failed at the angular-quickstart@1.0. build:watch script 'tsc -p src/ -w'.
[] npm ERR! Make sure you have the latest version of node.js and npm installed.
[] npm ERR! If you do, this is most likely a problem with the angular-quickstart package,
[] npm ERR! not with npm itself.
[] npm ERR! Tell the author that this fails on your system:
[] npm ERR! tsc -p src/ -w
[] npm ERR!
[] You can get information on how to open an issue for this project with:
[] npm ERR! npm bugs angular-quickstart
[] npm ERR! Or if that isn't available, you can get their info via:
[] npm ERR! npm owner ls angular-quickstart
[] npm ERR! There is likely additional logging output above.
[]
[] npm ERR! Please include the following file with any support request:
[] npm ERR! /home/gjj/download/worksp/quickstart-master/npm-debug.log
[] npm run build:watch exited with code
[] ** browser-sync config **
[] { injectChanges: false,
[] files: [ './**/*.{html,htm,css,js}' ],
[] watchOptions: { ignored: 'node_modules' },
[] server:
[] { baseDir: 'src',
[] middleware: [ [Function], [Function] ],
[] routes: { '/node_modules': 'node_modules' } } }
[] events.js:
[] throw er; // Unhandled 'error' event
[] ^
[]
[] Error: watch . ENOSPC
[] at exports._errnoException (util.js::)
[] at FSWatcher.start (fs.js::)
[] at Object.fs.watch (fs.js::)
[] at createFsWatchInstance (/home/gjj/download/worksp/quickstart-master/node_modules/_chokidar@1.7.@chokidar/lib/nodefs-handler.js::)
[] at setFsWatchListener (/home/gjj/download/worksp/quickstart-master/node_modules/_chokidar@1.7.@chokidar/lib/nodefs-handler.js::)
[] at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/gjj/download/worksp/quickstart-master/node_modules/_chokidar@1.7.@chokidar/lib/nodefs-handler.js::)
[] at FSWatcher.NodeFsHandler._handleDir (/home/gjj/download/worksp/quickstart-master/node_modules/_chokidar@1.7.@chokidar/lib/nodefs-handler.js::)
[] at FSWatcher.<anonymous> (/home/gjj/download/worksp/quickstart-master/node_modules/_chokidar@1.7.@chokidar/lib/nodefs-handler.js::)
[] at FSWatcher.<anonymous> (/home/gjj/download/worksp/quickstart-master/node_modules/_chokidar@1.7.@chokidar/lib/nodefs-handler.js::)
[] at FSReqWrap.oncomplete (fs.js::)
[]
[] npm ERR! Linux 4.10.--generic
[] npm ERR! argv "/usr/local/node/bin/node" "/usr/local/node/bin/npm" "run" "serve"
[] npm ERR! node v6.11.2
[] npm ERR! npm v3.10.10
[] npm
[] ERR! code ELIFECYCLE
[] npm ERR! angular-quickstart@1.0. serve: `lite-server -c=bs-config.json`
[] npm ERR! Exit status
[] npm ERR!
[] npm ERR! Failed at the angular-quickstart@1.0. serve script 'lite-server -c=bs-config.json'.
[] npm ERR! Make sure you have the latest version of node.js and npm installed.
[] npm
[] ERR! If you do, this is most likely a problem with the angular-quickstart package,
[] npm ERR! not with npm itself.
[] npm ERR! Tell the author that this fails on your system:
[] npm ERR! lite-server -c=bs-config.json
[] npm
[] ERR! You can get information on how to open an issue for this project with:
[] npm ERR! npm bugs angular-quickstart
[] npm ERR! Or if that isn't available, you can get their info via:
[] npm ERR! npm owner ls angular-quickstart
[] npm ERR! There is likely additional logging output above.
[]
[] npm ERR! Please include the following file with any support request:
[] npm ERR! /home/gjj/download/worksp/quickstart-master/npm-debug.log
[] npm run serve exited with code
npm ERR! code ELIFECYCLE
npm ERR! errno
npm ERR! angular-quickstart@1.0. start: `concurrently "npm run build:watch" "npm run serve"`
npm ERR! Exit status
npm ERR!
npm ERR! Failed at the angular-quickstart@1.0. start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/--14T13_05_48_238Z-debug.log

解决办法:我执行命令的位置是/home/gjj/xxx,这是一个用户目录,出现上面的原因是空间不足。我怀疑是此目录空间的问题,你可以先将项目移至/usr/local/xxx下再次npm start,如果还不行,请参看一下方案,此方案来自https://stackoverflow.com/questions/22475849/node-js-error-enospc

执行如下命令:

echo fs.inotify.max_user_watches= | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

对于Arch Linux,将下面这行添加到/etc/sysctl.d/99-sysctl.conf文件中

fs.inotify.max_user_watches=524288

vim /etc/sysctl.d/-sysctl.conf
#添加到最后
fs.inotify.max_user_watches=524288
#完成后执行
sysctl --system
 

最新文章

  1. select 相关
  2. Android开发究竟用什么工具,Eclipse||AS
  3. 立方体旋转 【web前端学习部落22群120342833】
  4. [iOS-UI]给输入框添加清除按钮的代码
  5. ionic 添加地图定位功能
  6. 在Winform开发框架中,利用DevExpress控件实现数据的快速录入和选择
  7. 将一个字符串映射为一个Delphi页面控件属性名(通过FindComponent和GetPropInfo找到这个控件指针)
  8. CSS——LESS
  9. ios inHouse 公布应用
  10. Lucene学习注意要点
  11. com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server 报错问题
  12. spring boot 入门之 helloworld
  13. 第34 memcached缓存
  14. notepad 正则表达式 复制 文本
  15. 监控网卡流量脚本(Python)
  16. Netty Tutorial Part 1: Introduction to Netty [z]
  17. IOS 禁止侧滑返回上个页面功能
  18. Nginx以服务方式启动并用定时任务每天备份日志
  19. chapter02“良/恶性乳腺癌肿瘤预测”的问题
  20. 180918-JDK之Deflater压缩与Inflater解压

热门文章

  1. oracle错误:1067进程意外终止
  2. websocket来回收发消息
  3. js封装xhr【重复造轮子】
  4. bzoj1878 [SDOI2009]HH的项链【莫队】
  5. 启动azkaban时出现User xml file conf/azkaban-users.xml doesn&#39;t exist问题解决(图文详解)
  6. CF781A Andryusha and Colored Balloons
  7. 【学习笔记】比特(bit)、字,字节(B)存储单位之间的关系+其与操作系统位数的关系+不同编译器编译方式下数据类型的表示范围
  8. Android学习笔记--Intent
  9. windows 查看某端口被占用情况
  10. Netbeans Makefile: recipe for target 'XXX' failed 运行failed(退出值 -1073741511 找不到C/C++库文件,关键字