首页 技术 正文
技术 2022年11月12日
0 收藏 944 点赞 3,779 浏览 1299 个字

默认已经安装好sublime、node和npm

1、sublime的node.js插件下载

由于在package control上经常下载失败,所以这里直接从GitHub上进行下载!

GitHub下载地址:https://github.com/tanepiper/SublimeText-Nodejs,下载ZIP压缩包。

2、node.js插件安装

(1)解压第2步中下载的压缩包SublimeText-Nodejs-master.zip

(2)打开目录..\Sublime Text 3\Packages,打开方式如下:

Node.js-sublime text3 配置node.js(ERROR: The process "node.exe" not found.)

(3)在目录中新建名为“Nodejs”的文件夹,将解压的插件文件拷贝进去,拷贝后效果如下图所示:

Node.js-sublime text3 配置node.js(ERROR: The process "node.exe" not found.)

3、node.js插件配置

(1)用sublime打开nodejs插件文件夹中的 Nodejs.sublime-build 文件并做如下修改,修改后保存:

{
"cmd": ["node", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.js",
"shell":true,
"encoding": "utf8", #这里修改
"windows":
{
#这里修改了 ,前面的是为了避免使用utf8 引起的编码错误 这个的意思 主要是 先杀死所有node进程然后在启动node进程
"cmd": ["chcp", "", "&", "taskkill", "/F", "/IM", "node.exe", "&", "node", "$file"]
},
"linux":
{
"cmd": ["killall node; node $file"]
},
"osx":
{
"cmd": ["killall node; node $file"]
}
}

(2)再用sublime打开nodejs插件文件夹中的 Nodejs.sublime-settings 文件并做如下修改,修改后保存:

{
// save before running commands
"save_first": true,
// if present, use this command instead of plain "node"
// e.g. "/usr/bin/node" or "C:\bin\node.exe"
"node_command": "F:\\nodejs\\node.exe", //node.exe 的位置
// Same for NPM command
"npm_command": "F:\\nodejs\\npm.cmd", //npm.cmd 的位置
// as 'NODE_PATH' environment variable for node runtime
"node_path":true, "expert_mode": false, "ouput_to_new_tab": false,
}

(3)创建一个 js 文件写入代码:

console.log("hello");

然后按下 ctrl + B 进行 Build 如果控制台提示:

Node.js-sublime text3 配置node.js(ERROR: The process "node.exe" not found.)

说明配置成功!

ERROR原因:cmd 在启动一个新的node时需要杀掉之前开启的node.exe,如果没有开启,就会提示ERROR没有找到node.exe进程。

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,492
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,907
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,740
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,495
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,132
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,295