-
Notifications
You must be signed in to change notification settings - Fork 61
Description
At first, I wanted to build something like in romcal v1.2.0 release—there’s an option to build and run it in BASH. I wanted to test the current (unreleased) version of the romcal code from romcal-es6 branch, but I couldn’t find out how.
Then, I’ve found out that it could be built using npm and with a web browser (e.g. firefox), so I tried it. Here is what I tried on Kubuntu 18.04 AMD64:
$ sudo apt-get install npm
# Output removed
$ sudo npm i -g npm
# Output removed
$ git clone [email protected]:pejulian/romcal.git -b romcal-es6 romcal_bt2
Cloning into 'romcal_bt2'...
remote: Counting objects: 2125, done.
remote: Total 2125 (delta 0), reused 0 (delta 0), pack-reused 2125
Receiving objects: 100% (2125/2125), 2.21 MiB | 836.00 KiB/s, done.
Resolving deltas: 100% (1552/1552), done.
$ cd romcal_bt2/
$ sudo npm install webpack webpack-cli
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
+ [email protected]
+ [email protected]
added 685 packages from 668 contributors and audited 5966 packages in 19.346s
found 13 vulnerabilities (2 low, 9 moderate, 2 high)
run `npm audit fix` to fix them, or `npm audit` for details
ts@ts-kubuntu:~/romcal_bt2$ sudo npm audit fix
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
up to date in 6.011s
fixed 13 of 13 vulnerabilities in 5966 scanned packages
$ sudo npm run build
> [email protected] build /home/ts/romcal_bt2
> webpack --config webpack.config.js
Hash: 5c3dad39147a9713ee0c
Version: webpack 4.12.0
Time: 587ms
Built at: 15/06/2018 19:41:27
Asset Size Chunks Chunk Names
romcal.bundle.min.js 8.4 KiB romcal [emitted] romcal
[./src/index.mjs] 3.81 KiB {romcal} [built]
[0] multi ./src/index.mjs 28 bytes {romcal} [built]
$ sudo npm install --save-dev webpack
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
+ [email protected]
updated 1 package and audited 5626 packages in 7.085s
found 0 vulnerabilities
$ sudo npm build romcal
npm ERR! path /home/ts/romcal_bt2/romcal/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/home/ts/romcal_bt2/romcal/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ts/.npm/_logs/2018-06-15T18_07_32_872Z-debug.log
$ cat /home/ts/.npm/_logs/2018-06-15T18_07_32_872Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/local/bin/npm', 'build', 'romcal' ]
2 info using [email protected]
3 info using [email protected]
4 info build /home/ts/romcal_bt2/romcal
5 verbose stack Error: ENOENT: no such file or directory, open '/home/ts/romcal_bt2/romcal/package.json'
6 verbose cwd /home/ts/romcal_bt2
7 verbose Linux 4.15.0-22-generic
8 verbose argv "/usr/bin/node" "/usr/local/bin/npm" "build" "romcal"
9 verbose node v8.10.0
10 verbose npm v6.1.0
11 error path /home/ts/romcal_bt2/romcal/package.json
12 error code ENOENT
13 error errno -2
14 error syscall open
15 error enoent ENOENT: no such file or directory, open '/home/ts/romcal_bt2/romcal/package.json'
16 error enoent This is related to npm not being able to find a file.
17 verbose exit [ -2, true ]This did not look good, however I couldn’t solve the errors. Nevertheless, I tried and opened the index.html file in firefoxand opened the web console. There were the following errors:
ReferenceError: exports is not defined [Learn More] romcal.bundle.min.js%20line%2098%20%3E%20eval:4:1
<anonymous> webpack:///./src/index.mjs?:4:1
./src/index.mjs file:///home/ts/romcal_bt2/dist/romcal.bundle.min.js:98:1
__webpack_require__ file:///home/ts/romcal_bt2/dist/romcal.bundle.min.js:20:12
<anonymous> webpack:///multi_./src/index.mjs?:1:18
[0] file:///home/ts/romcal_bt2/dist/romcal.bundle.min.js:110:1
__webpack_require__ file:///home/ts/romcal_bt2/dist/romcal.bundle.min.js:20:12
<anonymous> file:///home/ts/romcal_bt2/dist/romcal.bundle.min.js:84:18
<anonymous> file:///home/ts/romcal_bt2/dist/romcal.bundle.min.js:1:11
ReferenceError: Romcal is not defined [Learn More] index2.html:28:11
<anonymous> file:///home/ts/romcal_bt2/index2.html:28:11Btw, I think it would be better to use document.write() instead of console.log() (or both)—that way the output would be displayed in the <body> of the website. It might be even processed and styled with CSS.
So the question is: how could I test the romcal? How could I build it from source and either run it in BASH or in a web browser?