강의

멘토링

로드맵

Inflearn Community Q&A

redsunofsky5366's profile image
redsunofsky5366

asked

Creating Nodebird SNS with Vue

1-2. Installing nuxt and creating pages

npm run dev 할 때 에러가 발생합니다.

Written on

·

142

0

2강에서 서버 실행시 에러가 발생합니다.

무료 게임 강좌에서는 정상적으로 실행되었습니다.

 

node : 10.15.3

nuxt: 2.8.1

vue: 2.6.10

vue-server-renderer: 2.6.10

 

[로그 정보]

PS C:\vue-nodebird\ch1\front> npm run dev

> vue-nodebird-front@1.0.0 dev C:\vue-nodebird\ch1\front

> nuxt

WARN Address localhost:3000 is already in use. 11:49:13

i Trying a random port... 11:49:13

╭─────────────────────────────────────────────╮

│ │

│ Nuxt.js v2.8.1 │

│ Running in development mode (universal) │

│ │

│ Listening on: http://localhost:58015/

│ │

╰─────────────────────────────────────────────╯

i Preparing project for development 11:49:14

i Initial build may take a while 11:49:14

√ Builder initialized 11:49:14

√ Nuxt files generated 11:49:14

ERROR Unexpected token . 11:49:14

const r=Object.create(null),i=e=>globalThis.process?.env||undefined||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?r:globalThis),s$1=new Proxy(r,{get(e,o){return i()[o]??r[o]},has(e,o){const E=i();return o in E||o in r},set(e,o,E){const b=i(true);return b[o]=E,true},deleteProperty(e,o){if(!o)return false;const E=i(true);return delete E[o],true},ownKeys(){const e=i(true);return Object.keys(e)}}),t=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",B=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:true}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:true}],["CODEBUILD","CODEBUIL

SyntaxError: Unexpected token .

at new Script (vm.js:80:7)

at createScript (vm.js:274:10)

at Object.runInThisContext (vm.js:326:10)

at Module._compile (internal/modules/cjs/loader.js:664:28)

at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)

at Module.load (internal/modules/cjs/loader.js:600:32)

at tryModuleLoad (internal/modules/cjs/loader.js:539:12)

at Function.Module._load (internal/modules/cjs/loader.js:531:3)

at Module.require (internal/modules/cjs/loader.js:637:17)

at require (internal/modules/cjs/helpers.js:22:18)

at Object.<anonymous> (node_modules\@nuxt\friendly-errors-webpack-plugin\node_modules\consola\lib\index.cjs:2:13)

at Module._compile (internal/modules/cjs/loader.js:701:30)

at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)

at Module.load (internal/modules/cjs/loader.js:600:32)

at tryModuleLoad (internal/modules/cjs/loader.js:539:12)

at Function.Module._load (internal/modules/cjs/loader.js:531:3)

vue.jsnode.jsawsmysqlvuexssr

Quiz

Nuxt의 페이지 기반 라우팅은 파일 구조와 어떻게 연동될까요?

별도의 라우트 설정 파일에서 수동으로 정의해야 합니다.

`pages` 디렉토리의 파일 구조를 기반으로 라우트가 자동으로 생성됩니다.

컴포넌트 이름을 사용하여 라우트를 정의합니다.

레이아웃 파일에 정의된 구조에 따라 결정됩니다.

Answer 1

0

zerocho님의 프로필 이미지
zerocho
Instructor

노드버전이 너무 낮은데요. 10버전을 쓰시는 이유가 있으신가요?

redsunofsky5366님의 프로필 이미지
redsunofsky5366
Questioner

노드버전10은 무료게임 강좌에서 보여주신 버전을 참고해서 설치했구요.

강좌1에서 10버전대를 사용하라고 메모장에 넣어주셔서 10을 유지했던건데요.

 

node 최신버전(22.14.0)을 설치 했더니, 보안오류가 발생하여,

 

아래 명령어를 실행한 후

Set-ExecutionPolicy RemoteSigned

 

진행해보니, 정상적으로 동작합니다^^

감사합니다.

zerocho님의 프로필 이미지
zerocho
Instructor

22나 24버전을 사용하시는 것을 추천드립니다

redsunofsky5366's profile image
redsunofsky5366

asked

Ask a question