0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

npx create-react-app . --template typescriptができない

Last updated at Posted at 2022-06-10

npx create-react-app . --template typescriptができない

npx create-react-app . --template typescript
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
Cannot create a project named "20220610_最速で学ぶTypescript" because of npm naming restrictions:

  * name can only contain URL-friendly characters
  * name can no longer contain capital letters

Please choose a different project name.
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\Username\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Username\AppData\Local\npm-cache\_logs\2022-06-10T07_29_21_021Z-debug-0.log 

フォルダ名が日本語だとエラーが出てしまう。

解決策

英語で書く
npx create-react-app 好きな名前(英語で) --template typescript

注意:[--template typescript]を付けないと、作成ファイルが.tsではなく、.jsファイルになってしまう。

例)

npx create-react-app test_react --template typescript
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?