Skip to content

Commit 5bbe63a

Browse files
author
Maël Nison
committed
Makes the ownPath portable
1 parent eae3d82 commit 5bbe63a

File tree

1 file changed

+3
-1
lines changed
  • packages/react-scripts/scripts

1 file changed

+3
-1
lines changed

packages/react-scripts/scripts/init.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ module.exports = function(
8383
) {
8484
const ownPackageName = require(path.join(__dirname, '..', 'package.json'))
8585
.name;
86-
const ownPath = path.join(appPath, 'node_modules', ownPackageName);
86+
const ownPath = path.dirname(
87+
require.resolve(path.join(__dirname, '..', 'package.json'))
88+
);
8789
const appPackage = require(path.join(appPath, 'package.json'));
8890
const useYarn = fs.existsSync(path.join(appPath, 'yarn.lock'));
8991

0 commit comments

Comments
 (0)