Skip to content

Support versioned/tagged shorthand templates #475

Closed
@emin93

Description

@emin93

Environment

System:
    OS: macOS 10.14.5
    CPU: (8) x64 Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz
    Memory: 3.42 GB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.3.1 - /usr/local/bin/node
    npm: 6.10.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
    Android SDK:
      API Levels: 23, 25, 27, 28
      Build Tools: 23.0.1, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.2, 27.0.3, 28.0.3
      System Images: android-28 | Google APIs Intel x86 Atom
      Android NDK: 20.0.5594570
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5522156
    Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild

Description

When creating a project with a template that has an npm dist tag on it, the CLI fails with the following error:

✔ Downloading template
✖ Copying template
error Error: Cannot find module '/var/folders/kw/jlf9d4c53cx2rk1d_v43p1zm0000gn/T/rncli-init-template-HFTPnQ/node_modules/typescript/template.config'
Require stack:
- /Users/emin93/.npm/_npx/6297/lib/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/init/template.js
- /Users/emin93/.npm/_npx/6297/lib/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/init/init.js
- /Users/emin93/.npm/_npx/6297/lib/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/init/index.js
- /Users/emin93/.npm/_npx/6297/lib/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/index.js
- /Users/emin93/.npm/_npx/6297/lib/node_modules/react-native/node_modules/@react-native-community/cli/build/cliEntry.js
- /Users/emin93/.npm/_npx/6297/lib/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js
- /Users/emin93/.npm/_npx/6297/lib/node_modules/react-native/cli.js

The issue doesn't happen when I initialize the project with the local version of the template. I checked the npm tarball (npm pack react-native-template-typescript@next) and the template.config.js is there. I quickly had a look at the packageManager.js but I couldn't find the issue there either. Starting to run out of ideas 😢.

Reproducible Demo

npx react-native init MyApp --template=typescript@next

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions