Nodachisoft Nodachi Sword Icon
  
@Amaji✎ Update October-6-2020

Error handling records for node.js version up "Cannot find module @babel/compat-data/corejs3-shipped-proposals"

According to my research, there are some people who are experiencing the same kind of error in Vue CLI and React related environments, so I'd like to record how to solve the problem and other related information.

What happened?

When I updated node.js to the latest version v14.5 as of July 2020 and tried to start a project in Gatsby, a React-based static site generator, I got an error.

gatsby-run-failed-log
Error: Cannot find module '@babel/compat-data/corejs3-shipped-proposals'

Hmmm, from the error message, it seems that it can't get Babel-related modules and fails at the time of building.

Enviroment

When the error occurs, the environment is like this:

item version
OS Windows10 Home 64bit Build.18363
node.js 14.5.0
npm 6.14.5

Excerpt from package.json

An excerpt of the package version that caused the problem

Gatsby-Related-In-package.json
 "dependencies": {
   : Omit 
    "@babel/core": "^7.2.2",    "gatsby": "^2.20.29",
    "gatsby-image": "^2.2.44",
     :Omit 
 }

Causes and Solutions

It seems that loading of Babel packages using the Conditional Exports* feature in Node version 13.13 or later fails to load the package.

This is a *[Conditional Exports specification](https://nodejs.org/api/esm.html#esm_conditional_exports), so if you write the modules provided by the package in the exports field in package.json in the CommonJS or ES Module format, node.js will read them for you.

I found the same issue at github: Node.js Github- Issues - Errors from conditional exports after upgraded to Node 13.13 #32852

Solution

Since the babel package has already released a modified version, I will upgrade and get it again. Thank you very much.

If you are using the package below, please update to the corresponding version.

  • @babel/preset-env has to be 7.9.0 or higher.
  • @babel/core needs to be higher than 7.9.0.
  • @babel/compat-data needs to be 7.9.0 or higher.

From package.json

An excerpt of the revised packaged version is shown below

Fixed-package.json
 "dependencies": {
   : omit
    "@babel/core": "~7.9.0",    "@babel/compat-data": "~7.9.0",    "gatsby": "^2.20.29",
    "gatsby-image": "^2.2.44",
     : omit
 }

On my environment, @babel/core and @babel/compat-data are updated.

I updated with npm install and gatsby develop worked fine.

The end.

Solution #2

If you revert to node.js version 13.2 or earlier, that should solve the problem for now.

If you don't want to change the package too much, reverting back to version 13.2 or earlier should do the trick.

references

Update

  • October-06-2020 published
 
 
Message sent

Thank you for your message.

Something error has occured!

Sorry. The Error has occurred.We apologize for the inconvenience.Please try again in a few minutes or contact us via DM below.

Twitter:@NodachiSoft_eng
Name:
 
Replay To:
 
Message:
 
Back
Check the content!

Send the following information to us. If you are happy with your submission, please click "Send". If you want to modify it, please click "Back".

Name:
 
Reply To:
 
Message:
 
Enter a confirmation key to make sure that you are not operating from a Robot.
Confirmation Key is 95
Back
 / 
Go to Confirmation
Entry fields
Go to Confirmation

There are 0 articles that may be relevant!

広告領域
追従 広告領域
Table Of Contents
Error handling records for node.js version up "Cannot find module @babel/compat-data/corejs3-shipped-proposals"
Error handling records for node.js version up "Cannot find module @babel/compat-data/corejs3-shipped-proposals"
What happened?
What happened?
Enviroment
Enviroment
Excerpt from package.json
Excerpt from package.json
Causes and Solutions
Causes and Solutions
Solution
Solution
From package.json
From package.json
Solution #2
Solution #2
references
references
Update
Update
Nodachisoft © 2020