Skip to content

Couldn't find the template.config.js file inside "typescript" template #230

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

Closed
likern opened this issue Oct 29, 2021 · 5 comments
Closed

Comments

@likern
Copy link

likern commented Oct 29, 2021

Expected results

Failed to create project from template

What did you expect to happen?

Succussful RN project with TypeScript creation

Observed results

Снимок экрана от 2021-10-29 18-07-08

Logs

[packages]$ npx react-native init FeeveApp --template typescript
Need to install the following packages:
  react-native
Ok to proceed? (y) y
warn Package @react-native-community/eslint-config has been ignored because it contains invalid configuration. Reason: Cannot find module '@react-native-community/eslint-config/package.json'
Require stack:
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/tools/config/resolveNodeModuleDir.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/tools/releaseChecker/index.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/start/runServer.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/start/start.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/index.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/index.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/bin.js
warn Package eslint has been ignored because it contains invalid configuration. Reason: Cannot find module 'eslint/package.json'
Require stack:
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/tools/config/resolveNodeModuleDir.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/tools/releaseChecker/index.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/start/runServer.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/start/start.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/index.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/index.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/bin.js
warn Package eslint-plugin-prettier has been ignored because it contains invalid configuration. Reason: Cannot find module 'eslint-plugin-prettier/package.json'
Require stack:
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/tools/config/resolveNodeModuleDir.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/tools/releaseChecker/index.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/start/runServer.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/start/start.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/index.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/index.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/bin.js
warn Package eslint-plugin-react-hooks has been ignored because it contains invalid configuration. Reason: Cannot find module 'eslint-plugin-react-hooks/package.json'
Require stack:
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/tools/config/resolveNodeModuleDir.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/tools/releaseChecker/index.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/start/runServer.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/start/start.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/index.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/index.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/bin.js
warn Package lerna has been ignored because it contains invalid configuration. Reason: Cannot find module 'lerna/package.json'
Require stack:
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/tools/config/resolveNodeModuleDir.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/tools/releaseChecker/index.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/start/runServer.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/start/start.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/index.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/index.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/bin.js
warn Package typescript has been ignored because it contains invalid configuration. Reason: Cannot find module 'typescript/package.json'
Require stack:
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/tools/config/resolveNodeModuleDir.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/tools/releaseChecker/index.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/start/runServer.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/start/start.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/index.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/index.js
- /home/me/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/bin.js
                                                          
               ######                ######               
             ###     ####        ####     ###             
            ##          ###    ###          ##            
            ##             ####             ##            
            ##             ####             ##            
            ##           ##    ##           ##            
            ##         ###      ###         ##            
             ##  ########################  ##             
          ######    ###            ###    ######          
      ###     ##    ##              ##    ##     ###      
   ###         ## ###      ####      ### ##         ###   
  ##           ####      ########      ####           ##  
 ##             ###     ##########     ###             ## 
  ##           ####      ########      ####           ##  
   ###         ## ###      ####      ### ##         ###   
      ###     ##    ##              ##    ##     ###      
          ######    ###            ###    ######          
             ##  ########################  ##             
            ##         ###      ###         ##            
            ##           ##    ##           ##            
            ##             ####             ##            
            ##             ####             ##            
            ##          ###    ###          ##            
             ###     ####        ####     ###             
               ######                ######               
                                                          

                  Welcome to React Native!                
                 Learn once, write anywhere               

✔ Downloading template
✖ Copying template
error Error: Couldn't find the "/tmp/rncli-init-template-5vAI2Q/node_modules/typescript/template.config.js file inside "typescript" template. Please make sure the template is valid. Read more: https://github.com/react-native-community/cli/blob/master/docs/init.md#creating-custom-template

Steps to reproduce

  1. Call npx react-native init FeeveApp --template typescript inside monorepo setup in packages/ folder
  2. See failure
@likern
Copy link
Author

likern commented Oct 29, 2021

Doesn't relate to monorepo thing, it just doesn't work at all.

I suggest it's react-native cli bug, but not sure.

@emin93
Copy link
Member

emin93 commented Oct 29, 2021

typescript is not the correct template name.
Please use the correct template: npx react-native init MyApp --template react-native-template-typescript

@emin93 emin93 closed this as completed Oct 29, 2021
@likern
Copy link
Author

likern commented Oct 29, 2021

@emin93 I used command from official documentation
npx react-native init AwesomeTSProject --template react-native-template-typescript and it fails the same way.

Снимок экрана от 2021-10-29 19-15-06

@erikroznbeker
Copy link

It is some problem with newer yarn versions.
if I use yarn "berry" version yarn set version berry I get this error.
When I return to "normal" yarn yarn set version classic it works ok.

@georgeonofrei
Copy link

seems to be a yarn thing indeed. I've added the --npm flag on the command and the generation worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants