Home > Enterprise >  Error: Cannot find module '@babel/plugin-proposal-class-properties'
Error: Cannot find module '@babel/plugin-proposal-class-properties'

Time:08-15

Text from CLI (require stack):

- C:\As Sunnah Store\as_sunnah_client\node_modules\@babel\preset-env\lib\available-plugins.js
- C:\As Sunnah Store\as_sunnah_client\node_modules\@babel\preset-env\lib\filter-items.js
- C:\As Sunnah Store\as_sunnah_client\node_modules\@babel\preset-env\lib\index.js
- C:\As Sunnah Store\as_sunnah_client\node_modules\workbox-build\build\lib\bundle.js
- C:\As Sunnah Store\as_sunnah_client\node_modules\workbox-webpack-plugin\build\generate-sw.js
- C:\As Sunnah Store\as_sunnah_client\node_modules\workbox-webpack-plugin\build\index.js
- C:\As Sunnah Store\as_sunnah_client\node_modules\react-scripts\config\webpack.config.js
- C:\As Sunnah Store\as_sunnah_client\node_modules\react-scripts\scripts\start.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (C:\As Sunnah Store\as_sunnah_client\node_modules\@babel\preset-env\lib\available-plugins.js:40:38)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\As Sunnah Store\\as_sunnah_client\\node_modules\\@babel\\preset-env\\lib\\available-plugins.js',
    'C:\\As Sunnah Store\\as_sunnah_client\\node_modules\\@babel\\preset-env\\lib\\filter-items.js',
    'C:\\As Sunnah Store\\as_sunnah_client\\node_modules\\@babel\\preset-env\\lib\\index.js',
    'C:\\As Sunnah Store\\as_sunnah_client\\node_modules\\workbox-build\\build\\lib\\bundle.js',
    'C:\\As Sunnah Store\\as_sunnah_client\\node_modules\\workbox-webpack-plugin\\build\\generate-sw.js',
    'C:\\As Sunnah Store\\as_sunnah_client\\node_modules\\workbox-webpack-plugin\\build\\index.js',
    'C:\\As Sunnah Store\\as_sunnah_client\\node_modules\\react-scripts\\config\\webpack.config.js',
    'C:\\As Sunnah Store\\as_sunnah_client\\node_modules\\react-scripts\\scripts\\start.js'
  ]
}

How can I fix this problem?

CodePudding user response:

You can try installing @babel/plugin-proposal-class-properties:

npm install --save @babel/plugin-proposal-class-properties

CodePudding user response:

If you have already installed babel

In your directory check the file containing the packages you have installed and make sure that the symbol: @ was added before the babel import. Also, make sure the package numbers are in sync.

ex : "@babel/core": "^7.10.1"

If you have not installed it yet

Go to your terminal and type this command to install the latest version:

npm install --save-dev @babel/plugin-proposal-class-properties
  • Related