安装node.js可能出现的问题及解决方法
2017-03-16 15:46
716 查看
我在安装node.js时遇到很多问题,在网上搜索了很久,才找到这些靠谱的解决办法,现在收集整理一下,以备日后使用。
1.运行node.js出现 “socket: (10107)系统调用失败”
原因: winsock出错解决方法: 以管理员身份打开cmd,使用以下命令 netsh winsock reset重启电脑即可。
以管理员分身打开cmd:在C:\Windows\System32路径下找到cmd。
右击cmd,点击以管理员的身份运行,可以看到一个以管理员身份运的cmd程序。
参考网站:http://loli.la/2016/09/28/e8-bf-90-e8-a1-8c-node-js-e5-87-ba-e7-8e-b0-socket-10107-e7-b3-bb-e7-bb-9f-e8-b0-83-e7-94-a8-e5-a4-b1-e8-b4-a5-e3-80-82-e9-94-99-e8-af-af/ http://jingyan.baidu.com/article/e73e26c0f87c2424adb6a7f1.html
2.执行grunt -v:Reading "???" Gruntfile...ERRORA valid Gruntfile could not be found. Please see the getting started guide formore information on how to configure grunt: http://gruntjs.com/getting-startedFatal error: Unable to find Gruntfile.
注意:grunt命令时安装grunt-cli模块时产生的,如果只是安装grunt模块是不会有grunt命令的。 写Gruntfile配置文件,在当前目录下新建一个文件,命名为Gruntfile.js,内容如下。//包装函数module.exports = function(grunt) { //任务配置 grunt.initConfig({ 'hello-world':{} }); //自定义任务 grunt.registerTask('hello-world', 'My "asyncfoo" task.', function() { grunt.log.writeln('hello world'); }); grunt.registerTask('default', ['hello-world']);};然后再当前目录执行下grunt命令,输出如下:C:\模拟磁盘\projects\grunt\grunt-helloworld>gruntRunning "hello-world" taskhello world Done, without errors. 这里自定义一个输出hello world的模块,然后让grunt框架使用它。 参考网站:http://blog.csdn.net/larrywangsun/article/details/27428093
1.运行node.js出现 “socket: (10107)系统调用失败”
原因: winsock出错解决方法: 以管理员身份打开cmd,使用以下命令 netsh winsock reset重启电脑即可。
以管理员分身打开cmd:在C:\Windows\System32路径下找到cmd。
右击cmd,点击以管理员的身份运行,可以看到一个以管理员身份运的cmd程序。
参考网站:http://loli.la/2016/09/28/e8-bf-90-e8-a1-8c-node-js-e5-87-ba-e7-8e-b0-socket-10107-e7-b3-bb-e7-bb-9f-e8-b0-83-e7-94-a8-e5-a4-b1-e8-b4-a5-e3-80-82-e9-94-99-e8-af-af/ http://jingyan.baidu.com/article/e73e26c0f87c2424adb6a7f1.html
2.执行grunt -v:Reading "???" Gruntfile...ERRORA valid Gruntfile could not be found. Please see the getting started guide formore information on how to configure grunt: http://gruntjs.com/getting-startedFatal error: Unable to find Gruntfile.
注意:grunt命令时安装grunt-cli模块时产生的,如果只是安装grunt模块是不会有grunt命令的。 写Gruntfile配置文件,在当前目录下新建一个文件,命名为Gruntfile.js,内容如下。//包装函数module.exports = function(grunt) { //任务配置 grunt.initConfig({ 'hello-world':{} }); //自定义任务 grunt.registerTask('hello-world', 'My "asyncfoo" task.', function() { grunt.log.writeln('hello world'); }); grunt.registerTask('default', ['hello-world']);};然后再当前目录执行下grunt命令,输出如下:C:\模拟磁盘\projects\grunt\grunt-helloworld>gruntRunning "hello-world" taskhello world Done, without errors. 这里自定义一个输出hello world的模块,然后让grunt框架使用它。 参考网站:http://blog.csdn.net/larrywangsun/article/details/27428093
相关文章推荐
- Node.js安装express框架出现的问题级解决
- 已安装好的Ubuntu启动出现 busybox initramfs 问题可能的解决方法
- Win8.1慎用优化,可能导致安装驱动出现数据无效的问题。附解决方法
- hadoop 安装出现的几种异常的处理方法,hadoop无法启动,no namenode to stop问题的解决方法,no datanode
- FAQ: Solaris系统下安装Perl模块可能出现的问题和解决方法
- Win7,Win8安装ArcGIS软件或Node.js等安装包出现2503错误的解决方法
- 安装node.js 遇到 error code为2503,2502问题解决方法
- Crosswalk Cordova windows下编译出现:bin\node_modules\q\q.js:126 throw e问题解决方法
- 解决node.js安装cnpm、grunt、bower出现的不是内部或外部命令问题
- hadoop 安装出现的几种异常的处理方法,hadoop无法启动,no namenode to stop问题的解决方法,no datanode
- linux下安装node出现的node命令找不到,express命令找不到的问题,解决方法。
- ubuntu安装海思sdk 可能出现的问题及解决方法
- [置顶] Win8.1慎用360优化,可能导致安装驱动出现数据无效的问题。附解决方法
- Node.js安装express框架出现的问题级解决
- 关于electron安装失败问题解决方法(node.js开发桌面应用)
- fbcunn在Ubuntu 14.04下安装可能出现的问题以及解决方法
- Visual Studio 2015 Update 1 成功安装后运行 “出现未能正确加载[XXXX]包,此问题可能是由配置更改或安装另一个扩展导致的。” 可能的解决方法
- windows 2003中安装net Framework 2.0 后Reporting Service 出现问题及其解决方法
- 安装软件出现Error 1327 Invalid Drive X:/(X为盘符,有可能是C~Z)的解决方法
- 安装VS2008后再装Office2007的时候出现的问题解决方法