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

Use Default NPM Package Manager of User if Lock File Exists In Base Path #1187

Merged
merged 2 commits into from
Dec 5, 2022
Merged

Use Default NPM Package Manager of User if Lock File Exists In Base Path #1187

merged 2 commits into from
Dec 5, 2022

Conversation

andrewdwallo
Copy link
Contributor

@andrewdwallo andrewdwallo commented Dec 5, 2022

This PR will fix errors that occur after initial Jetstream installation if a User is using an NPM package manager other than NPM itself

Many people initially start a fresh Laravel project by configuring their database and using their favorite package manager whether that be npm, yarn, or pnpm. Jetstream's Console InstallCommand.php file autoloads the bundling of assets using npm as the default package manager even while a user may be already using pnpm or yarn. If a user is already using pnpm or yarn they will receive an error in their terminal that looks similar to the following:

298 error code EUNSUPPORTEDPROTOCOL
299 error Unsupported URL Type "link:": link:./src/types
300 verbose exit 1
301 timing npm Completed in 14690ms
302 verbose unfinished npm timer reify 1670217709459
303 verbose unfinished npm timer reify:loadTrees 1670217709463
304 verbose unfinished npm timer idealTree:buildDeps 1670217709596
305 verbose unfinished npm timer idealTree:node_modules/.pnpm/[email protected]/node_modules/vite 1670217715885
306 verbose code 1
307 error A complete log of this run can be found in:
307 error     C:\Users\andre\AppData\Local\npm-cache\_logs\2022-12-05T05_21_48_152Z-debug-0.log

Even though this is an easy fix for the user by just finishing installation and migrating their tables, people who are unexperienced may not know what is going on or may think there is a problem to find and fix in their project...

A simple fix to this is just adding the following sections of code in the "InstallCommand.php" file. People like to use their default "favorite" package manager and I see no harm in allowing them to. For this reason alone I am submitting this PR...

@taylorotwell taylorotwell merged commit bfed92d into laravel:2.x Dec 5, 2022
@andrewdwallo andrewdwallo deleted the use-default-package-manager branch December 5, 2022 17:36
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

Successfully merging this pull request may close these issues.

2 participants