
[axios, jest] Cannot use import statement outside a module 에러 해결
·
Trouble Shooting
axios 버전: 1.1.3 jest 버전: ^29.2.1 새로운 프로젝트를 시작하면서 package.json의 모듈 버전들을 다 upgrade해보았다. 리액트 프로젝트에서 jest로 테스트 코드를 작성했는데, 실행을 하니 axios를 import하는 부분에서 Cannot use import statement outside a module라는 오류가 발생했다. D:\--\node_modules\axios\index.js:1 ({"Object.":function(module,exports,require,__dirname,__filename,jest){import axios from './lib/axios.js'; SyntaxError: Cannot use import statement outside a m..