最好这个js的文件名为index 在index.js路径下打开一个cmd 然后输入 npm init 一路回车如果index.js中有其他模块的依赖则 cnpm i 模块 最后运行 node index.js 回车