我试图在一个名为hello.js的单独文件中运行用javascript编写的hello world程序
目前正在运行node.js的windows版本.
代码在控制台窗口中运行完美,但如何在Windows环境中引用该路径.
C:\abc\zyx\hello.js
Run Code Online (Sandbox Code Playgroud)
在Unix中我猜它显示$ node hello.js
我是Node.js的新手.如果我做错了,请纠正我.
我试过了
> node C:\abc\zyx\hello.js ----没用
> C:\abc\zyx\hello.js - 不行
UPDATE1:
将node.exe添加到hello.js文件所在的文件夹中.
添加了文件夹c:\ abc\zyx \的路径点,我收到一条错误消息
ReferenceError:未定义hello
看到hello.js的内容
setTimeout(function() {
console.log('World!');
}, 2000);
console.log('Hello');
Run Code Online (Sandbox Code Playgroud)
更新2:
到目前为止,我已经尝试了所有这些版本,但它们似乎都没有用.可能是我做错了.
>node hello.js
>$ node hello.js
>node.exe hello.js
>node /hello.js
>node \hello.js
> \node \hello.js
> /node /hello.js
> C:\abc\xyz\node.exe C:\abc\xyz\hello.js
> C:\abc\xyz\node.exe C:/abc/xyz/hello.js
> hello.js
> /hello.js
> \hello.js
>node hello
Run Code Online (Sandbox Code Playgroud)
请参阅我的文件结构

已解决:请 尝试使用以下选项在命令提示符下运行,而不是运行node.exe.
c:\>node c:\abc\hello.js
Hello
World! (after 2 secs)
Run Code Online (Sandbox Code Playgroud) 我希望我的.bat脚本(test.bat)创建一个自己的快捷方式,以便我可以将它复制到我的Windows 8 Startup文件夹.
我写了这行代码来复制文件,但我还没有找到创建所述快捷方式的方法,因为你可以看到它只复制脚本.
xcopy "C:\Users\Gabriel\Desktop\test.bat" "C:\Users\Gabriel\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
Run Code Online (Sandbox Code Playgroud)
你能帮我吗?
让我们以 Github 文档中的复合操作为例:
name: 'Hello World'
description: 'Greet someone'
inputs:
who-to-greet: # id of input
description: 'Who to greet'
required: true
default: 'World'
outputs:
random-number:
description: "Random number"
value: ${{ steps.random-number-generator.outputs.random-id }}
runs:
using: "composite"
steps:
- run: echo Hello ${{ inputs.who-to-greet }}.
shell: bash
- id: random-number-generator
run: echo "::set-output name=random-id::$(echo $RANDOM)"
shell: bash
- run: ${{ github.action_path }}/goodbye.sh
shell: bash
Run Code Online (Sandbox Code Playgroud)
我们如何random-number在调用此操作的外部工作流程中使用该特定输出?我尝试了以下代码片段,但目前工作流程似乎无法从操作中读取输出变量,因为它只是空的 - '输出 - '
jobs:
test-job:
runs-on: self-hosted
steps:
- name: Call Hello …Run Code Online (Sandbox Code Playgroud) 我注意到,每当终端上抛出异常时,我经常会得到一个简短的故障跟踪,例如:
java.lang.NoClassDefFoundError: javafx/application/Application
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javafx.application.Application
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 13 more
Exception in thread "main"
Run Code Online (Sandbox Code Playgroud)
我想知道的是如何打印所有的痕迹,包括那些... 13 more.
编辑:这篇文章已被确定为 …
我正在尝试使用EGit插件将我的eclipse java项目与我的私有git存储库同步,但我没有成功.我已将远程原点配置为:
URI:git@github.com:username/project.git
主持人:github.com
存储库路径:username/project.git
不幸的是,当我尝试获取时,我收到此错误:
git@github.com:Maslor/wfmgr.git:ProxyHTTP:java.io.IOException:proxy error:> Forbidden git@github.com:Maslor/wfmgr.git:ProxyHTTP:java.io.IOException:proxy error:> Forbidden git@github.com:Maslor/wfmgr.git:ProxyHTTP:java.io.IOException:proxy error:> Forbidden
我正在使用代理,这是否意味着我必须配置EGit的代理设置,如果有的话?我怎样才能做到这一点?
我正在尝试编写一个python程序,检查给定的字符串是否为pangram - 包含字母表中的所有字母.
因此,"We promptly judged antique ivory buckles for the next prize"应该返回True任何不包含字母表的每个字母的字符串至少一次返回False.
我相信我应该使用RegEx这个,但我不知道如何.它看起来应该类似于:
import sys
import re
input_string_array = sys.stdin.readlines()
input_string = input_string_array[0]
if (re.search('string contains every letter of the alphabet',input_string):
return True
else:
return False
Run Code Online (Sandbox Code Playgroud)