B
Blueprintβ€’2y ago
Tonis

Installation Problem

[INFO] Rolling admin cache refresh class name.
[INPUT] Do you want to migrate your database? (Y/n)
y
[INFO] Running database migrations..

INFO Nothing to migrate.

[INFO] Changing file ownership to www-data.
[INFO] Removing placeholder files.
[INFO] Rebuilding panel assets..
yarn run v1.22.19
$ yarn run clean && cross-env NODE_ENV=production ./node_modules/.bin/webpack --mode production
$ cd public/assets && find . \( -name "*.js" -o -name "*.map" \) -type f -delete
node:events:495
throw er; // Unhandled 'error' event
^

Error: spawn ./node_modules/.bin/webpack ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:284:19)
at onErrorNT (node:internal/child_process:477:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:290:12)
at onErrorNT (node:internal/child_process:477:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn ./node_modules/.bin/webpack',
path: './node_modules/.bin/webpack',
spawnargs: [ '--mode', 'production' ]
}

Node.js v18.18.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[INFO] Updating route cache to include recent changes..
[INFO] Rolling admin cache refresh class name.
[INPUT] Do you want to migrate your database? (Y/n)
y
[INFO] Running database migrations..

INFO Nothing to migrate.

[INFO] Changing file ownership to www-data.
[INFO] Removing placeholder files.
[INFO] Rebuilding panel assets..
yarn run v1.22.19
$ yarn run clean && cross-env NODE_ENV=production ./node_modules/.bin/webpack --mode production
$ cd public/assets && find . \( -name "*.js" -o -name "*.map" \) -type f -delete
node:events:495
throw er; // Unhandled 'error' event
^

Error: spawn ./node_modules/.bin/webpack ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:284:19)
at onErrorNT (node:internal/child_process:477:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:290:12)
at onErrorNT (node:internal/child_process:477:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn ./node_modules/.bin/webpack',
path: './node_modules/.bin/webpack',
spawnargs: [ '--mode', 'production' ]
}

Node.js v18.18.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[INFO] Updating route cache to include recent changes..
What could be causing this error?
30 Replies
Tonis
TonisOPβ€’2y ago
This error came after i installed cross-env npm i -g cross-env because before it was throwing that it didint exist
Flame
Flameβ€’2y ago
you are on node v18, so maybe try adding the node option that pterodactyl docs has given
Tonis
TonisOPβ€’2y ago
Alright will have a look i tried with node v20 also
Flame
Flameβ€’2y ago
anything above node 16 needs that option for rebuilding pterodactyl
Jake
Jakeβ€’2y ago
@Tonis Linux : export NODE_OPTIONS=--openssl-legacy-provider Windows : set NODE_OPTIONS=--openssl-legacy-provider
Tonis
TonisOPβ€’2y ago
DIdin't resolve it
Jake
Jakeβ€’2y ago
Can you send the log wrapped in β€˜ So it doesn’t ruin formatting and make it ass to read try yarn i Its looking for webpack and cannot find it
The error message you provided suggests that there is an issue with running the Webpack build process in your project. Specifically, it's encountering an "ENOENT" error, which typically means that the file or command it's trying to run cannot be found.

Here are some steps you can take to troubleshoot and potentially fix this issue:

Check if Webpack is installed: Ensure that Webpack is installed as a dependency in your project. You can do this by running npm list webpack or yarn list webpack in your project's root directory. If it's not installed, you should add it to your project's dependencies using npm install webpack or yarn add webpack.

Check your package.json: Inspect your package.json file to make sure that the scripts for running Webpack are correctly defined. There should be a script in your package.json like "scripts": { "build": "webpack" } or something similar. Make sure the script is defined correctly and points to the Webpack binary.

Check the path to Webpack: The error message indicates that it's trying to spawn ./node_modules/.bin/webpack, so make sure that the webpack binary exists in that location. You can manually check the ./node_modules/.bin/ directory to see if webpack is there. If it's missing, it might be an issue with the installation or the project structure.

Check your Node.js version: Ensure that the version of Node.js you are using (v18.18.0 in this case) is compatible with the version of Webpack you have installed. You might need to update Node.js or specify a different Node.js version in your project if there's a compatibility issue.

Check for missing dependencies: Sometimes, missing or corrupted dependencies can cause issues like this. Try running npm install or yarn install to make sure all project dependencies are correctly installed.

Check for global vs. local installations: If you have Webpack installed globally (npm install -g webpack), it might conflict with the local installation in your project. Ensure that you are using the local version defined in your project's node_modules.

Check for configuration issues: Review your Webpack configuration files (usually webpack.config.js) to ensure there are no errors or misconfigurations in them that could be causing the problem.

After checking these points, try running the Webpack build process again. If the issue persists, please provide more details about your project setup, including the content of your package.json and Webpack configuration, to help diagnose the problem further.
The error message you provided suggests that there is an issue with running the Webpack build process in your project. Specifically, it's encountering an "ENOENT" error, which typically means that the file or command it's trying to run cannot be found.

Here are some steps you can take to troubleshoot and potentially fix this issue:

Check if Webpack is installed: Ensure that Webpack is installed as a dependency in your project. You can do this by running npm list webpack or yarn list webpack in your project's root directory. If it's not installed, you should add it to your project's dependencies using npm install webpack or yarn add webpack.

Check your package.json: Inspect your package.json file to make sure that the scripts for running Webpack are correctly defined. There should be a script in your package.json like "scripts": { "build": "webpack" } or something similar. Make sure the script is defined correctly and points to the Webpack binary.

Check the path to Webpack: The error message indicates that it's trying to spawn ./node_modules/.bin/webpack, so make sure that the webpack binary exists in that location. You can manually check the ./node_modules/.bin/ directory to see if webpack is there. If it's missing, it might be an issue with the installation or the project structure.

Check your Node.js version: Ensure that the version of Node.js you are using (v18.18.0 in this case) is compatible with the version of Webpack you have installed. You might need to update Node.js or specify a different Node.js version in your project if there's a compatibility issue.

Check for missing dependencies: Sometimes, missing or corrupted dependencies can cause issues like this. Try running npm install or yarn install to make sure all project dependencies are correctly installed.

Check for global vs. local installations: If you have Webpack installed globally (npm install -g webpack), it might conflict with the local installation in your project. Ensure that you are using the local version defined in your project's node_modules.

Check for configuration issues: Review your Webpack configuration files (usually webpack.config.js) to ensure there are no errors or misconfigurations in them that could be causing the problem.

After checking these points, try running the Webpack build process again. If the issue persists, please provide more details about your project setup, including the content of your package.json and Webpack configuration, to help diagnose the problem further.
This is what ChatGPT is saying
Tonis
TonisOPβ€’2y ago
Yeah Already checked chatgpt πŸ˜„ root@eugamehost:/var/www/pterodactyl# yarn build:production yarn run v1.22.19 $ yarn run clean && cross-env NODE_ENV=production ./node_modules/.bin/webpack --mode production $ cd public/assets && find . \( -name "*.js" -o -name "*.map" \) -type f -delete node:events:492 throw er; // Unhandled 'error' event ^ Error: spawn ./node_modules/.bin/webpack ENOENT at ChildProcess._handle.onexit (node:internal/child_process:286:19) at onErrorNT (node:internal/child_process:484:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) Emitted 'error' event on ChildProcess instance at: at ChildProcess._handle.onexit (node:internal/child_process:292:12) at onErrorNT (node:internal/child_process:484:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { errno: -2, code: 'ENOENT', syscall: 'spawn ./node_modules/.bin/webpack', path: './node_modules/.bin/webpack', spawnargs: [ '--mode', 'production' ] } Node.js v20.7.0 error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Jake
Jakeβ€’2y ago
Have you check if webpack is within your node_modules folder?
Tonis
TonisOPβ€’2y ago
Its not i tried running yarn add webpack it works but then it starts saying new errors like webpack.config.js not found etc
Jake
Jakeβ€’2y ago
Might have to try a fresh install
Tonis
TonisOPβ€’2y ago
yeah thats with a fresh install no blueprint installed
Jake
Jakeβ€’2y ago
in a sense of rm -r /var/www/pterodactyl then remaking the dir and extracting the panel folders?
Tonis
TonisOPβ€’2y ago
yeah fresh installs just same .env tried changing node versions also going to try node v16 at this point i guess but doubt will fix anything have no idea what it could be at this point anymore
solong
solongβ€’2y ago
I got the same exact error in the post, my node version is v19.9.0 and my yarn version is 1.22.19 Tried with a fresh install of the panel, but no luck
Jake
Jakeβ€’2y ago
@Emma Seems like blueprint has become suicidal
Tonis
TonisOPβ€’2y ago
I wish I could build pterodactyl files :X
Jake
Jakeβ€’2y ago
Try manual installing a plugin its even worse
Tonis
TonisOPβ€’2y ago
Well that was my plan xd
Emma
Emmaβ€’2y ago
uhh @Tonis Do you perhaps have another modification installed (other than Blueprint)?
Tonis
TonisOPβ€’2y ago
No its happening even without any modifications just default pterodactyl installation it doesn't let me build or anything it does create a node_modules but there is no webpack in it
Emma
Emmaβ€’2y ago
strange have you ran yarn without any arguments yet?
Tonis
TonisOPβ€’2y ago
yeah Followed everything that it was in readme.md and even on ptero docs yarn runs with no errors Now am getting a new error at this point ill just install it on a vps πŸ™‚
Emma
Emmaβ€’2y ago
just for some additional information: - i've experienced this error once as well, don't know how i fixed it - it would be really strange if blueprint caused this error, as it only overwrites one react file, where it adds only one line of code
Tonis
TonisOPβ€’2y ago
yeah i dont think blueprint does since it happens on a fresh install of pterodactyl
Emma
Emmaβ€’2y ago
yeah i'm confused lmao what os are you running on your server?
Tonis
TonisOPβ€’2y ago
debian 12
Emma
Emmaβ€’2y ago
should be good blueprint is tested on debian so yeah very good os πŸ‘
Tonis
TonisOPβ€’2y ago
Guess can close this ill just install the panel on a vps hope don't encounter this πŸ˜„
Emma
Emmaβ€’2y ago
aight my recommendation is to avoid the latest nodejs versions on your next install, as older ones are more documented if you experience version-specific errors if you have any more questions, feel free to mention me

Did you find this page helpful?