问题:在执行命令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
 

npm start问题的更多相关文章

  1. 网络原因导致 npm 软件包 node-sass / gulp-sass 安装失败的处理办法

    如果你正在构建一个基于 gulp 的前端自动化开发环境,那么极有可能会用到 gulp-sass ,由于网络原因你可能会安装失败,因为安装过程中部分细节会到亚马逊云服务器上获取文件.本文主要讨论在不变更 ...

  2. npm 私有模块的管理使用

    你可以使用 NPM 命令行工具来管理你在 NPM 仓库的私有模块代码,这使得在项目中使用公共模块变的更加方便. 开始前的工作 你需要一个 2.7.0 以上版本的 npm ,并且需要有一个可以登陆 np ...

  3. NPM (node package manager) 入门 - 基础使用

    什么是npm ? npm 是 nodejs 的包管理和分发工具.它可以让 javascript 开发者能够更加轻松的共享代码和共用代码片段,并且通过 npm 管理你分享的代码也很方便快捷和简单. 截至 ...

  4. Npm包的开发

    个人开发包的目录结构 ├── coverage //istanbul测试覆盖率生成的文件 ├── index.js //入口文件 ├── introduce.md //说明文件 ├── lib │   ...

  5. npm package.json属性详解

    概述 本文档是自己看官方文档的理解+翻译,内容是package.json配置里边的属性含义.package.json必须是一个严格的json文件,而不仅仅是js里边的一个对象.其中很多属性可以通过np ...

  6. npm 使用小结

    本文内容基于 npm 4.0.5 概述 npm (node package manager),即 node 包管理器.这里的 node 包就是指各种 javascript 库. npm 是随同 Nod ...

  7. Node.js npm 详解

    一.npm简介 安装npm请阅读我之前的文章Hello Node中npm安装那一部分,不过只介绍了linux平台,如果是其它平台,有前辈写了更加详细的介绍. npm的全称:Node Package M ...

  8. 升级npm

    查看npm的所有版本 运行命令: npm view npm versions 命令运行后,会输出到目前为止npm的所有版本. [ '1.1.25', '1.1.70', '1.1.71', '1.2. ...

  9. NPM如何更新到最新版

    参考文章--npm更新到最新版本的方法 其实我们可以这样,随便新建一个文件夹例如:F:\test.按着"shift"键,右键该文件夹,选择"在此处打开命令窗口(W)&qu ...

  10. npm源切换

    版权声明:欢迎转载,请附加转载来源:一路博客(http://www.16boke.com)   目录(?)[+] 安装 使用 列出可选的源 切换 增加源 删除源 测试速度 许可 项目主页   我们介绍 ...

随机推荐

  1. pyrcharm 编程规范

    正常变量赋值, 等号左右各一个空格: 参数赋值, 等号左右都没有空格: 注释#后面一个空格 类定义和函数定义,前后各两行,而在类的里面定义成员函数,只需要空一行 文件最后一个空行 变量.函数.类最好都 ...

  2. scrapy 用法总结

    待更新: 建立python开发虚拟环境 virtualenv  mkvirtualenv --python=the-path-to-the-python-you-want-to use 安装: 使用p ...

  3. python 中site-packages 和 dist-packages的区别

    dist-packages is a Debian-specific convention that is also present in its derivatives, like Ubuntu. ...

  4. 通过split命令分割大文件

    场景 线上出了问题,我需要去查找log来定位问题,但是由于线上数据量庞大,这些log文件每过一个小时就会自动回滚一次,尽管如此,有的log文件依然达到了五六g以上的大小. 对于这种巨大的log文件,常 ...

  5. macos php安装扩展sqlsrv连接sqlserver

    Install the PHP Drivers for SQL Serve sudo pecl install pdo_sqlsrv   sudo pecl install sqlsrv 微软官方文档 ...

  6. AtCoder Grand Contest 012 A

    A - AtCoder Group Contest Time limit : 2sec / Memory limit : 256MB Score : 300 points Problem Statem ...

  7. 如何改变CSV文件的编码

    通常我.csv文件的编码都不是我们想要的,比如我要把他保存为Utf-8格式的,好让我可以导入数据库,不乱码 工具/原料电脑,.csv文件方法/步骤1首先,将.csv文件保存一下.然后鼠标右击打开方式记 ...

  8. java 自定义注解,并使用示例

    场景: 对需要校验  手机验证码和短信验证码的controller方法添加 自定义的注解 @CheckType 1. 定义注解 /** * 需要短信.验证码验证方法上的注解 * date: 2018年 ...

  9. htm 中 <b>和<strong>的区别

    显示上两者没有任何区别,都是粗体<b>:为了加粗而加粗,推荐使用 css font-weight 属性来创建粗体文字.<strong>:为了强调而加粗,表示十分重要.在网页中使 ...

  10. Javaweb学习笔记7—JDBC技术

      今天来讲javaweb的第7阶段学习. JDBC技术,关于JDBC本篇博客只介绍了它的一部分,后面博客会更加深入探讨. 老规矩,首先先用一张思维导图来展现今天的博客内容.   ps:我的思维是用的 ...