Skip to content

Commit d366039

Browse files
Jack ZhaoTimer
Jack Zhao
authored andcommitted
Support scoped packages for cra --scripts-version option (facebook#4677)
1 parent 1407287 commit d366039

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/create-react-app/createReactApp.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@ function createApp(name, verbose, version, useNpm, template) {
214214
if (!semver.satisfies(process.version, '>=6.0.0')) {
215215
console.log(
216216
chalk.yellow(
217-
`You are using Node ${process.version} so the project will be bootstrapped with an old unsupported version of tools.\n\n` +
217+
`You are using Node ${
218+
process.version
219+
} so the project will be bootstrapped with an old unsupported version of tools.\n\n` +
218220
`Please update to Node 6 or higher for a better, fully supported experience.\n`
219221
)
220222
);
@@ -228,7 +230,9 @@ function createApp(name, verbose, version, useNpm, template) {
228230
if (npmInfo.npmVersion) {
229231
console.log(
230232
chalk.yellow(
231-
`You are using npm ${npmInfo.npmVersion} so the project will be boostrapped with an old unsupported version of tools.\n\n` +
233+
`You are using npm ${
234+
npmInfo.npmVersion
235+
} so the project will be boostrapped with an old unsupported version of tools.\n\n` +
232236
`Please update to npm 3 or higher for a better, fully supported experience.\n`
233237
)
234238
);
@@ -409,7 +413,7 @@ function getInstallPackage(version, originalDirectory) {
409413
if (validSemver) {
410414
packageToInstall += `@${validSemver}`;
411415
} else if (version) {
412-
if (version[0] === '@') {
416+
if (version[0] === '@' && version.indexOf('/') === -1) {
413417
packageToInstall += version;
414418
} else if (version.match(/^file:/)) {
415419
packageToInstall = `file:${path.resolve(

0 commit comments

Comments
 (0)