Minetrack
Minetrack copied to clipboard
Issue with `npm run build`
installed the minetracker and was getting cannot GET/ tried npm run build but getting this error :
🚨 Build failed.
@parcel/core: Failed to resolve 'uplot/dist/uPlot.min.css' from './assets/css/ma in.css'
/root/Minetrack/assets/css/main.css:1:9
1 | @import url(uplot/dist/uPlot.min.css); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | 3 | @import url(../css/icons.css);
@parcel/resolver-default: Cannot load file './uplot/dist/uPlot.min.css' in './as sets/css'.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: eslint assets/js/*.js && parcel build assets/ht ml/index.html --dist-dir dist
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional log ging output above.
npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2021-07-20T08_22_46_771Z-debug.log root@vmi624939:~/Minetrack# cd /root/.npm/_logs^C root@vmi624939:~/Minetrack# nano /root/.npm/_logs/2021-07-20T08_22_46_771Z-debug .log
The log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/bin/npm', 'run', 'build' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]~prebuild: [email protected]
6 info lifecycle [email protected]~build: [email protected]
7 verbose lifecycle [email protected]~build: unsafe-perm in lifecycle true
8 verwbose lifecycle [email protected]~build: PATH: /usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/root/Minetrack/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle [email protected]~build: CWD: /root/Minetrack
10 silly lifecycle [email protected]~build: Args: [
10 silly lifecycle '-c',
10 silly lifecycle 'eslint assets/js/*.js && parcel build assets/html/index.html --dist-dir dist'
10 silly lifecycle ]
11 silly lifecycle [email protected]~build: Returned: code: 1 signal: null
12 info lifecycle [email protected]~build: Failed to exec build script
13 verbose stack Error: [email protected] build: eslint assets/js/*.js && parcel build assets/html/index.html --dist-dir dist
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.eslint assets/js/*.js && parcel build assets/html/index.html --dist-dir dist
22 error Exit status 1
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Are you running x86/x86_64 based OS or arm64 ? If arm, please check issue #261
It doesn't look like an arch-related issue. It's saying it can't find the uplot
dependency. First, make sure it's installed by running npm i
and check it runs successfully. You can then proceed as normal.
even after installing uplot dependency by npm install uplot
and running npm i
its still giving the same error
I'm having the same issue as @joppari
npm run build
[email protected] build eslint assets/js/*.js && parcel build assets/html/index.html --dist-dir dist
🚨 Build failed.
@parcel/core: Failed to resolve 'uplot/dist/uPlot.min.css' from './assets/css/main.css'
/var/www/html/assets/css/main.css:1:9
1 | @import url(uplot/dist/uPlot.min.css); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | 3 | @import url(../css/icons.css);
@parcel/resolver-default: Cannot load file './uplot/dist/uPlot.min.css' in './assets/css'.
Any fixes? Thanks
Now I notice that it's trying to resolve the uplot/dist/uPlot.min.css
path relative to the main.css
file. Can you try changing line 1 of assets/css/main.css
by
@import url(npm:uplot/dist/uPlot.min.css);
If this fixes it, feel free to PR the change :) It also wouldn't hurt to try updating the parcel
dependency to the latest version (2.7.0
as of now) -- we're still using an ancient beta.
Now I notice that it's trying to resolve the
uplot/dist/uPlot.min.css
path relative to themain.css
file. Can you try changing line 1 ofassets/css/main.css
by@import url(npm:uplot/dist/uPlot.min.css);
If this fixes it, feel free to PR the change :) It also wouldn't hurt to try updating the
parcel
dependency to the latest version (2.7.0
as of now) -- we're still using an ancient beta.
i have same issuse like him, after i change like you said:
[email protected] build eslint assets/js/*.js && parcel build assets/html/index.html --dist-dir dist
🚨 Build failed.
@parcel/transformer-js: Browser scripts cannot have imports or exports.
/www/wwwroot/minetrack/assets/js/main.js:1:1
1 | import { App } from './app' | ^ 2 | 3 | const app = new App()
/www/wwwroot/minetrack/assets/html/index.html:15:2 14 |
15 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The environment was originally created here 16 | 17 |
Minetrack
📝 Learn more: https://parceljs.org/languages/javascript/#classic-scripts
/tmp/build-97e55a3e.sh: line 1: 72246 Segmentation fault parcel build assets/html/index.html --dist-dir dist
i'm using @parcel/[email protected], even i change parcel in package.json to 2.0.0-beta.3.1 or 2.1.1 still have that error. hope you reply, thanks.
I migrated my Minetrack instance to new server. Cloned this repo, ran all the npm commands and it worked just fine. I did have some issues with sqlite on AlmaLinux 8.6 but you can fix it by doing installing sqlite via yum (or dnf, whatever you wanna use) and then running command npm install --build-from-source --sqlite3=/usr/bin/sqlite3
to use local sqlite in the build than the one you get from Node repos.
TL;DR: Do not use releases, since they are outdated, clone the repo instead.