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 3 years have passed since last update.

nuxtで環境構築エラー String does not match the pattern of "^(?:@[a-z0-9-*~][a-z0-9-*._~]*/)?[a-z0-9-~][a-z0-9-._~]*$". 

Posted at

知らずに入口でつまづいた話

nuxtに限りませんが、初学者あるあるかもしれません。nuxt.jsの学習中の環境構築にて

$ npx create-nuxt-app my_app
$ cd my_app
$ npm run dev

をする所、どうせ「my-app」部分はフォルダが生成されるから、いいやと思い

$ npx create-nuxt-app
$ npm run dev

として、作業を進めていた所、作業途中で、何やらエラーが、、、

//エラーメッセージ
String does not match the pattern of "^(?:@[a-z0-9-*~][a-z0-9-*._~]*/)?[a-z0-9-~][a-z0-9-._~]*$".
package.json
{
  "name": "MyApp", //ここが間違い
  "version": "1.0.0",
  "private": true,

<経緯>
デスクトップに「MyApp」フォルダを作る 
→ エディタのワークスペースにデスクトップの「MyApp」フォルダを追加。
→ 直接「$ npx create-nuxt-app」
→ 作業途中にエラー発生!!
→ 以下、規約がある事知らず...

:point_up:nameの主な規約!
・214文字以下(@scope/を含む)
・一文字目は「.(ドット)」「_(アンダースコア)」以外
・大文字は禁止
・URL、コマンドライン引数、フォルダ名の一部になるため、URLで使用可能な文字、記号

結局、以下で作業進めました。皆さんも気をつけてください。

$ npx create-nuxt-app my_app
$ cd my_app
$ npm run dev

参考
nuxt.jsガイド
package.json の 仕様 (日本語)

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?