无法将 npm 终端设置为 VS 代码/windows
unable to set npm terminal into VS code / windows
我想安装react,所以我搜索了一下,发现必须先下载npm
所以我去下载 npm,我看到我必须下载节点并在 VS 代码终端中设置它
我下载 nodejs.zip
但它在这个路径 C:\node\node.exe
之后我去cmd写了node -v
,回复:
'node' is not recognized as an internal or external command,
operable program or batch file.
然后我去控制面板写了系统变量的路径
同样的事情发生了
我在 Whosebug 中搜索,我发现我最常在 cmd 中写 SET PATH=C:\node\node.exe;%PATH%
它工作但没有一段时间,在重新启动 PC 后错误仍然存在
然后我像这样将节点路径添加到 settings.json 文件
"terminal.integrated.profiles.windows": {
.
.
.
"Node Js": {
"path": "C:\node\node.exe"
}
},
并设为默认值
"terminal.integrated.defaultProfile.windows": "Node Js",
最后,现在我可以 运行 在 VS 代码中节点“好节奏”
但是...
当我在节点终端回复中写 node -v
时:
Uncaught ReferenceError: node is not defined
当 npm init react-app myApp
:
npm should be run outside of the Node.js REPL, in your normal shell.
(Press Ctrl+D to exit.)
以及 npx create-react-app hi
:
npx create-react-app hi
^ ^ ^ ^ ^ ^ //pointing on create
Uncaught SyntaxError: Unexpected identifier
我只想运行这个npm init react-app myApp
或npm init react-app myApp
命令
用于节点或其他任何东西的 IDC
我想安装react,所以我搜索了一下,发现必须先下载npm 所以我去下载 npm,我看到我必须下载节点并在 VS 代码终端中设置它
我下载 nodejs.zip
但它在这个路径 C:\node\node.exe
之后我去cmd写了node -v
,回复:
'node' is not recognized as an internal or external command, operable program or batch file.
然后我去控制面板写了系统变量的路径 同样的事情发生了
我在 Whosebug 中搜索,我发现我最常在 cmd 中写 SET PATH=C:\node\node.exe;%PATH%
它工作但没有一段时间,在重新启动 PC 后错误仍然存在
然后我像这样将节点路径添加到 settings.json 文件
"terminal.integrated.profiles.windows": {
.
.
.
"Node Js": {
"path": "C:\node\node.exe"
}
},
并设为默认值
"terminal.integrated.defaultProfile.windows": "Node Js",
最后,现在我可以 运行 在 VS 代码中节点“好节奏”
但是...
当我在节点终端回复中写 node -v
时:
Uncaught ReferenceError: node is not defined
当 npm init react-app myApp
:
npm should be run outside of the Node.js REPL, in your normal shell. (Press Ctrl+D to exit.)
以及 npx create-react-app hi
:
npx create-react-app hi
^ ^ ^ ^ ^ ^ //pointing on
create
Uncaught SyntaxError: Unexpected identifier
我只想运行这个npm init react-app myApp
或npm init react-app myApp
命令
用于节点或其他任何东西的 IDC