-
-
Notifications
You must be signed in to change notification settings - Fork 27k
Add global deprecate warning on create-react-app package #7452
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ const dns = require('dns'); | |
const envinfo = require('envinfo'); | ||
const execSync = require('child_process').execSync; | ||
const fs = require('fs-extra'); | ||
const isInstalledGlobally = require('is-installed-globally'); | ||
const hyperquest = require('hyperquest'); | ||
const inquirer = require('inquirer'); | ||
const os = require('os'); | ||
|
@@ -124,6 +125,10 @@ const program = new commander.Command(packageJson.name) | |
}) | ||
.parse(process.argv); | ||
|
||
if (isInstalledGlobally) { | ||
console.log(`global installation for create-react-app is deprecated.`); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think is good if you use
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
But I do agree that we should use colouring! :) A few other thoughts:
Edit: Actually @Taym95, I've noted that we do use console.warn in other places in our Node scripts - so that's a great suggestion ;) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We may need a short URL for that - @ianschmitz, do you know if we have one? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not to my knowledge @mrmckeb. |
||
} | ||
|
||
if (program.info) { | ||
console.log(chalk.bold('\nEnvironment Info:')); | ||
return envinfo | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a simple way to achieve this without an extra dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to get a current global path for
npm
oryarn
and check it against the current executing path fornpm
oryarn
.Not sure if it possible internally without dependency in create-react-app script.