beeware/batavia

./stdlib is not present in '../pybee/batavia/batavia'

parthpahariya opened this issue · 8 comments

Expected Behavior

Current Behavior

ERROR in ./batavia/batavia.js
Module not found: Error: Can't resolve './stdlib' in '/home/parth/pybee/batavia/batavia'
@ ./batavia/batavia.js 21:20-39

ERROR in ./batavia/builtins/import.js
Module not found: Error: Can't resolve '../stdlib' in '/home/parth/pybee/batavia/batavia/builtins'
@ ./batavia/builtins/import.js 72:25-45
@ ./batavia/builtins.js
@ ./batavia/batavia.js

Steps to reproduce

Your Environment

  • Python Version (list the specific version number)

  • Operating System and Version (select from the following and list the specific version number; if your OS is not listed, list that as well)

    • OSX
    • Linux
    • Windows
    • Ubuntu

Hi @parthpahariya, this file is generated in the npm run build step of the quickstart.

Try running through all the steps https://github.com/pybee/batavia#quick-start and see if you can get it working.

Thanks!

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

while doing "npm install"

jedie commented

I ran into the same Problem:

...
+ npm run build
...

ERROR in ./batavia/batavia.js
Module not found: Error: Can't resolve './stdlib' in '/root/pybee/batavia/batavia'
 @ ./batavia/batavia.js 21:20-39

ERROR in ./batavia/builtins/__import__.js
Module not found: Error: Can't resolve '../stdlib' in '/root/pybee/batavia/batavia/builtins'

I'm trying to run the quickstart tutorial via docker.

The Dockerfile is here: https://github.com/jedie/batavia-docker/blob/master/Dockerfile

The full output is here: https://travis-ci.org/jedie/batavia-docker/builds/353335832#L1118-L1123

The issue is probably due to a failure during npm install.

Log line 1086 looks like the only manifestation of that; the compile_stdlib step hasn't executed due to some sort of problem with the working directory. I can't say I've seen that particular error before, though.

jedie commented

Hm. You mean:

npm WARN lifecycle @pybee/batavia@3.4.0-dev.19~prepare: cannot run in wd %s %s (wd=%s) @pybee/batavia@3.4.0-dev.19 python compile_stdlib.py /root/pybee/batavia

Any idea what i can do to figure out the real problem?

Not a clue, sorry. At a guess, I'd say it's something to do with Docker's filesystem protection layer, but I'd need to dig into this to debug it any further.

This is due to the error in compile of '/batavia-dev/batavia/compile_stdlib.py' file.
Do:
$cd batavia-dev
$cd batavia
$ sudo python3 compile_stdlib.py

@Badal1234 No. You DO NOT need to use sudo to build or run any part of BeeWare.

sudo is not a magic "make it work" command. It's a highly dangerous security control granting root access to your operating system. There are legitimate reasons to use it - this is not one of them.

Before using sudo, you should have a good understanding of what it is you are giving permissions to, and why that tool needs those permissions. In this case, there is no reason for Batavia to require root permissions. Batavia is entirely user-space code.

If you are seeing problems that are "fixed" by using sudo, then I suspect you haven't followed the instructions provided in the tutorial - most likely, you are installing the code somewhere that you don't have permissions, or you aren't using a virtual environment.