leeda-cloud
Cannot use import statement outside a module 에러 해결법 본문
세팅 중 Cannot use import statement outside a module 라는 에러가 나왔다.
import문을 사용할 수 없다는 건데, 이건 간단히 해결할 수 있다.
// package.json
{
"type": "module"
}
그러고 다시 실행하면 멀쩡하게 돌아간다!
만약 위 방법이 안 통한다면 아래 참고 url에 들어가면 다양한 해결법이 있다.
SyntaxError: Cannot use import statement outside a module
I've got an ApolloServer project that's giving me trouble, so I thought I might update it and ran into issues when using the latest Babel. My "index.js" is: require('dotenv').config() imp...
stackoverflow.com
'에러' 카테고리의 다른 글
Npm ERR code EJSONPARSE Failed to parse json 에러 해결법 (0) | 2023.11.08 |
---|---|
[Gulp] The following tasks did not complete: Did you forget to signal async completion? 에러 해결법 (0) | 2023.04.14 |
[chrome] 크롬 브라우저 커서 깜빡임 해결법 (0) | 2023.01.25 |
[Gulp] failed to load external module babel/register 해결법 (0) | 2023.01.06 |
[Git] not a git repository (or any of the parent directories): .git 해결법 (0) | 2023.01.05 |
Comments