Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with npm run build #264

Closed
joppari opened this issue Jul 20, 2021 · 7 comments
Closed

Issue with npm run build #264

joppari opened this issue Jul 20, 2021 · 7 comments

Comments

@joppari
Copy link

joppari commented Jul 20, 2021

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. (/usr/share/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:375:28)
13 verbose stack at ChildProcess. (/usr/share/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:375:28)
13 verbose stack at maybeClose (internal/child_process.js:1055:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid [email protected]
15 verbose cwd /root/Minetrack
16 verbose Linux 5.4.0-62-generic
17 verbose argv "/usr/local/bin/node" "/usr/bin/npm" "run" "build"
18 verbose node v14.17.3
19 verbose npm v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build: 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 ]

@JantsoP
Copy link
Contributor

JantsoP commented Jul 20, 2021

Are you running x86/x86_64 based OS or arm64 ? If arm, please check issue #261

@hugmanrique
Copy link
Contributor

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.

@joppari
Copy link
Author

joppari commented Jul 20, 2021

even after installing uplot dependency by npm install uplot and running npm i its still giving the same error

@z0ren
Copy link

z0ren commented Oct 7, 2022

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

@hugmanrique
Copy link
Contributor

hugmanrique commented Oct 8, 2022

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.

@loditcodon
Copy link

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.

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 | <script defer src="../js/main.js"></script>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The environment was originally created here
16 |
17 | <title>Minetrack</title>

📝 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.

@JantsoP
Copy link
Contributor

JantsoP commented Oct 16, 2022

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.

@Cryptkeeper Cryptkeeper closed this as not planned Won't fix, can't repro, duplicate, stale Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants