Javascript: permission denied - Stack Overflow

I've followed this tutorial for Rabbitmq in Javascript. These are the codes:.js.jsBut, when I tr

I've followed this tutorial for Rabbitmq in Javascript. These are the codes: .js

.js

But, when I try to run them with ./send.js and/or ./recv.js it gives me "Permission denied" error.

I look for some solutions but I don't understand, or I find something about IE (that it's not my case) - plus I don't think the problem is the browser (?) If it's so... why? :/

I've followed this tutorial for Rabbitmq in Javascript. These are the codes: https://github./rabbitmq/rabbitmq-tutorials/blob/master/javascript-nodejs/src/send.js

https://github./rabbitmq/rabbitmq-tutorials/blob/master/javascript-nodejs/src/receive.js

But, when I try to run them with ./send.js and/or ./recv.js it gives me "Permission denied" error.

I look for some solutions but I don't understand, or I find something about IE (that it's not my case) - plus I don't think the problem is the browser (?) If it's so... why? :/

Share Improve this question asked Jan 24, 2017 at 11:18 SaraSara 571 silver badge5 bronze badges 1
  • Possible duplicate of Is it possible to run JavaScript files from the mand line? – Thomas Commented Feb 4, 2018 at 22:01
Add a ment  | 

2 Answers 2

Reset to default 3

Well, i think you are wrong with few things... you are trying to run it without node or an interpreter.

  • If a file it's not a module like file, you should use node ./file.js
  • If a file it's a module you must to use something like this var myModule = require('./myModule.js); and use its functions.
  • If a file it's a browser script you should use like this <script src="/file.js"></script> and use its functions.

I don't know that software and how it works, but that are the essentials usages of mon javascript files.

You're trying to run Javascript from the mand line. This answer details how to do it with Node, with instructions from Command Line Javascript. Here's a quick rundown:

  • Download and install Node
  • Create the file hello.js containing just one line:
    console.log('Hello, world');
  • Running your program is easy; invoke node on the file containing your program:
    node hello.js

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745633321a4637239.html

相关推荐

  • Javascript: permission denied - Stack Overflow

    I've followed this tutorial for Rabbitmq in Javascript. These are the codes:.js.jsBut, when I tr

    22天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信