Skip to content

Commit deb7872

Browse files
committed
Global installs dont have a local node_modules, so use __dirname
1 parent ae19b67 commit deb7872

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

packages/create-react-app/createReactApp.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,19 @@ function isUsingYarn() {
5454
}
5555

5656
function hasGivenWarning() {
57-
const ourPackageInNodeModules = path.join('node_modules', packageJson.name);
58-
const warningFilePath = path.join(
59-
ourPackageInNodeModules,
57+
const localWarningFilePath = path.join(
58+
__dirname,
6059
'given-deprecation-warning'
6160
);
62-
return fs.existsSync(warningFilePath);
61+
return fs.existsSync(localWarningFilePath);
6362
}
6463

6564
function writeWarningFile() {
66-
const ourPackageInNodeModules = path.join('node_modules', packageJson.name);
67-
const warningFilePath = path.join(
68-
ourPackageInNodeModules,
65+
const localWarningFilePath = path.join(
66+
__dirname,
6967
'given-deprecation-warning'
7068
);
71-
fs.writeFileSync(warningFilePath, 'true');
69+
fs.writeFileSync(localWarningFilePath, 'true');
7270
}
7371

7472
let projectName;

0 commit comments

Comments
 (0)