node.js - sublime2 下配置nodejs 问题

 奋斗中DU_536 发布于 2022-11-07 15:56

本来配置好的,昨天突然出现问题了。ctrl + B 后什么都不显示。然后查看了下控制台

Running node E:\fate\test\test.js
Traceback (most recent call last):
  File ".\sublime_plugin.py", line 337, in run_
  File ".\exec.py", line 154, in run
  File ".\exec.py", line 45, in __init__
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa3 in position 228: ordinal not in range(128)

这是我的node_build设置

{
  "cmd": ["node", "$file"],
  "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
  "selector": "source.js?1.2.1",
  "shell":true,
  "encoding": "cp1252",
  "windows":
    {
      "cmd": ["node", "$file"]
    },
  "linux":
    {
        "cmd": ["killall node; node", "$file"]
    }
}

试了下

"encoding": "utf-8"

也不行。。。。网上各种方法都试了下都不行

1 个回答
  • 如果要在py文件里写中文,必须要添加一行声明文件编码的注释,否则会默认使用ASCII编码
    # -*- coding:utf-8 -*-

    2022-11-12 01:43 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有