json

SyntaxError: Cannot use import statement outside a module 해결 import 방법으로 외부 라이브러리를 불러올 때, 해당 문구를 출력하며, import 라이브러리를 불러오지 못하는 경우가 발생했다. package.json 파일에 가서 "type":"module"을 추가해줍니다, 이는 script 방식으로 불러오는 것으로 기본값이 set되어 있어서, module 방식으로 바꿔준 것 입니다. package.json 파일 { "name": "node", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && ex..