getting-started-with-javascript
getting-started-with-javascript copied to clipboard
运行node提示错误,因为多执行了一步node环境
运行node程序时,进入到文件夹后,不需要执行进入node环境。 主要原因是看到“>"符号,就认为需要执行进入node环境。因为执行node环境后,也会出现这个符号。所以才导致的这个问题。
正确的流程:
-
cd getting-started-with-javascript/study/lesson2
-
node sample_code.js
我的错误的流程:
-
cd getting-started-with-javascript/study/lesson2
-
cd lesson2 node
-
node sample_code.js
nodejs有两个执行方式。
-
node的终端运行环境。这个环境可以用于简单的小代码验证。
-
node的运行环境。这就是正在执行代码的环境。