-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[codemod] script fails with "Cannot find module 'core-js/modules/es.symbol.js' #28499
Comments
Does the issue persist with |
@eps1lon Yes, I'm still having the issue. |
I have also tried changing node versions to v12.16.0, but I get the same error. |
I found a workaround from this issue. Running the script from a different directory than my project ensures that npx doesn't use the dependencies from my project. |
@Ryshackleton Thanks for the heads up. Looks like this is an issue with |
I would be happy to add something about this workaround to the |
Feel free to submit a PR! thanks a lot. |
When running the v4 -> v5 codemod, the script fails with "Cannot find module 'core-js/modules/es.symbol.js'
Current Behavior 😯
Script fails with
Error: Cannot find module 'core-js/modules/es.symbol.js'
Output from: `npx @mui/codemod@next v5.0.0/preset-safe ./app`
npx @mui/codemod@next v5.0.0/preset-safe ./app npx: installed 251 in 9.911s Executing command: jscodeshift /Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node_modules/jscodeshift/bin/jscodeshift.js --transform /Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/preset-safe.js --extensions js,ts,jsx,tsx --parser tsx --ignore-pattern **/node_modules/** /Users/ryshack/MAMP_SERVER/evidence/app Processing 209 files... Spawning 7 workers... Sending 30 files to free worker... Sending 30 files to free worker... Sending 30 files to free worker... Sending 30 files to free worker... Sending 30 files to free worker... Sending 30 files to free worker... Sending 29 files to free worker... internal/modules/cjs/loader.js:892 throw err; ^Error: Cannot find module 'core-js/modules/es.symbol.js'
Require stack:
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object. (/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/adapter-v4.js:3:1)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Module._compile (/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node_modules/pirates/lib/index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Object.newLoader [as .js] (/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node_modules/pirates/lib/index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:937:32) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/adapter-v4.js',
'/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/preset-safe.js',
'/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node_modules/jscodeshift/src/Worker.js'
]
}
internal/modules/cjs/loader.js:892
throw err;
^
Error: Cannot find module 'core-js/modules/es.symbol.js'
Require stack:
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object. (/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/adapter-v4.js:3:1)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Module._compile (/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node_modules/pirates/lib/index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Object.newLoader [as .js] (/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node_modules/pirates/lib/index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:937:32) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/adapter-v4.js',
'/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/preset-safe.js',
'/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node_modules/jscodeshift/src/Worker.js'
]
}
internal/modules/cjs/loader.js:892
throw err;
^
Error: Cannot find module 'core-js/modules/es.symbol.js'
Require stack:
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object. (/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/adapter-v4.js:3:1)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Module._compile (/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node_modules/pirates/lib/index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Object.newLoader [as .js] (/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node_modules/pirates/lib/index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:937:32) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/adapter-v4.js',
'/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/preset-safe.js',
'/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node_modules/jscodeshift/src/Worker.js'
]
}
internal/modules/cjs/loader.js:892
throw err;
^
Error: Cannot find module 'core-js/modules/es.symbol.js'
Require stack:
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object. (/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/adapter-v4.js:3:1)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Module._compile (/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node_modules/pirates/lib/index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Object.newLoader [as .js] (/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node_modules/pirates/lib/index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:937:32) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/adapter-v4.js',
'/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/preset-safe.js',
'/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node_modules/jscodeshift/src/Worker.js'
]
}
internal/modules/cjs/loader.js:892
throw err;
^
Error: Cannot find module 'core-js/modules/es.symbol.js'
Require stack:
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object. (/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/adapter-v4.js:3:1)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Module._compile (/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/ninternal/modules/cjs/loader.js:892
throw err;
^
Error: Cannot find module 'core-js/modules/es.symbol.js'
Require stack:
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object. (/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/adapter-v4.js:3:1)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Module._compile (/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node_modules/pirates/lib/index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Object.newLoader [as .js] (/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node_modules/pirates/lib/index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:937:32) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/adapter-v4.js',
'/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/preset-safe.js',
'/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node_modules/jscodeshift/src/Worker.js'
]
}
ode_modules/pirates/lib/index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Object.newLoader [as .js] (/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node_modules/pirates/lib/index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:937:32) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/adapter-v4.js',
'/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/preset-safe.js',
'/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node_modules/jscodeshift/src/Worker.js'
]
}
internal/modules/cjs/loader.js:892
throw err;
^
Error: Cannot find module 'core-js/modules/es.symbol.js'
Require stack:
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object. (/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/adapter-v4.js:3:1)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Module._compile (/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node_modules/pirates/lib/index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Object.newLoader [as .js] (/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node_modules/pirates/lib/index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:937:32) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/adapter-v4.js',
'/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node/v5.0.0/preset-safe.js',
'/Users/ryshack/.npm/_npx/77462/lib/node_modules/@mui/codemod/node_modules/jscodeshift/src/Worker.js'
]
}
All done.
Results:
0 errors
0 unmodified
0 skipped
0 ok
Time elapsed: 4.957seconds
Expected Behavior 🤔
Codemod script should run without errors.
Steps to Reproduce 🕹
Steps:
npx @mui/codemod@next v5.0.0/preset-safe ./app
Context 🔦
Update MUI from v4->v5
Your Environment 🌎
My package.json dependencies/dev dependencies
"dependencies": { "@ant-design/icons": "^4.6.4", "@emotion/react": "^11.4.1", "@emotion/styled": "^11.3.0", "@fortawesome/fontawesome-pro": "^5.15.4", "@fortawesome/fontawesome-svg-core": "^1.2.36", "@fortawesome/free-brands-svg-icons": "^5.15.4", "@fortawesome/free-regular-svg-icons": "^5.15.4", "@fortawesome/free-solid-svg-icons": "^5.15.4", "@fortawesome/pro-duotone-svg-icons": "^5.15.4", "@fortawesome/pro-light-svg-icons": "^5.15.4", "@fortawesome/pro-regular-svg-icons": "^5.15.4", "@fortawesome/pro-solid-svg-icons": "^5.15.4", "@fortawesome/react-fontawesome": "^0.1.15", "@material-ui/core": "^4.12.3", "@material-ui/data-grid": "^4.0.0-alpha.37", "@material-ui/lab": "^4.0.0-alpha.60", "@mui/lab": "^5.0.0-alpha.46", "@mui/material": "^5.0.0-rc.1", "@mui/styles": "^5.0.0-rc.1", "antd": "^4.16.13", "array-to-tree": "^3.3.2", "blob": "^0.1.0", "classnames": "^2.3.1", "d3": "^7.0.3", "d3-array": "^3.0.4", "d3-delaunay": "^6.0.2", "d3-format": "^3.0.1", "d3-interpolate-path": "^2.2.3", "d3-scale": "^4.0.1", "d3-shape": "^3.0.1", "file-saver": "2.0.5", "focus-visible": "^5.2.0", "fraction.js": "^4.1.1", "intersection-observer": "0.12.0", "jquery": "^3.6.0", "labella": "^1.1.4", "lodash": "^4.17.21", "patch-package": "^6.4.7", "prop-types": "15.7.2", "qs": "^6.10.1", "query-string": "^7.0.1", "re-reselect": "4.0.0", "react": "^17.0.2", "react-aria-live": "^2.0.5", "react-dom": "^17.0.2", "react-highlight-words": "^0.17.0", "react-query": "^3.24.3", "react-redux": "^7.2.5", "react-style-proptype": "3.2.2", "react-use": "^17.3.1", "redux": "^4.1.1", "redux-actions": "2.6.5", "redux-logic": "^3.0.3", "reselect": "4.0.0", "resize-observer-polyfill": "1.5.1", "sass-mq": "5.0.1", "unorm": "1.6.0" }, "devDependencies": { "@babel/core": "^7.15.5", "@babel/plugin-proposal-class-properties": "^7.14.5", "@babel/plugin-proposal-export-default-from": "^7.14.5", "@babel/plugin-proposal-export-namespace-from": "^7.14.5", "@babel/plugin-proposal-object-rest-spread": "^7.15.6", "@babel/preset-env": "^7.15.6", "@babel/preset-react": "^7.14.5", "@babel/register": "^7.15.3", "@babel/runtime": "^7.15.4", "@testing-library/dom": "^8.5.0", "@testing-library/jest-dom": "^5.14.1", "@testing-library/react": "^12.1.0", "@testing-library/react-hooks": "^7.0.2", "acorn": "^8.5.0", "autoprefixer": "^10.3.4", "babel-eslint": "10.1.0", "babel-jest": "^27.2.1", "babel-loader": "8.2.2", "babel-plugin-import": "1.13.3", "babel-plugin-transform-imports": "2.0.0", "browser-sync": "^2.27.5", "browser-sync-webpack-plugin": "^2.3.0", "clean-webpack-plugin": "^4.0.0", "copy-webpack-plugin": "^9.0.1", "core-js": "^3.18.0", "css-loader": "^6.3.0", "cssnano": "^5.0.8", "eslint": "^7.32.0", "eslint-config-airbnb": "18.2.1", "eslint-config-prettier": "^8.3.0", "eslint-import-resolver-webpack": "^0.13.1", "eslint-loader": "4.0.2", "eslint-plugin-compat": "^3.13.0", "eslint-plugin-import": "^2.24.2", "eslint-plugin-jest": "^24.4.2", "eslint-plugin-jsx-a11y": "6.4.1", "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-react": "^7.25.3", "eslint-plugin-react-hooks": "4.2.0", "eslint-plugin-simple-import-sort": "^7.0.0", "eslint-plugin-sort-destructure-keys": "1.3.5", "eslint-plugin-testing-library": "^4.12.3", "esm": "3.2.25", "fibers": "5.0.0", "file-loader": "6.2.0", "identity-obj-proxy": "3.0.0", "imports-loader": "^3.0.0", "jest": "^27.2.1", "jest-axe": "^5.0.1", "jest-chain": "1.1.5", "jest-extended": "0.11.5", "jest-runner-eslint": "^0.10.1", "jest-runner-stylelint": "^2.3.7", "jest-watch-select-projects": "^2.0.0", "jest-watch-toggle-config": "^2.0.1", "jest-watch-typeahead": "^0.6.4", "less": "^4.1.1", "less-loader": "^10.0.1", "mini-css-extract-plugin": "^2.3.0", "node-sass": "^6.0.1", "optimize-css-assets-webpack-plugin": "^6.0.1", "postcss": "^8.3.6", "postcss-loader": "^6.1.1", "prettier": "^2.4.1", "react-test-renderer": "^17.0.2", "redux-devtools-extension": "^2.13.9", "sass": "^1.41.1", "sass-loader": "^12.1.0", "style-loader": "^3.2.1", "stylelint": "^13.13.1", "stylelint-a11y": "1.2.3", "stylelint-config-css-modules": "2.2.0", "stylelint-config-prettier": "8.0.2", "stylelint-config-sass-guidelines": "^8.0.0", "stylelint-config-standard": "^22.0.0", "stylelint-no-unsupported-browser-features": "^5.0.2", "stylelint-prettier": "^1.2.0", "terser-webpack-plugin": "^5.2.4", "webpack": "^5.53.0", "webpack-assets-manifest": "^5.0.6", "webpack-bundle-analyzer": "^4.4.2", "webpack-cli": "^4.8.0", "webpack-config": "7.5.0", "webpack-notifier": "^1.13.0" },`npx @mui/envinfo`
System:
OS: macOS 11.6
CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
Memory: 183.96 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.17.4 - /usr/local/bin/node
npm: 6.14.14 - /usr/local/bin/npm
Managers:
Composer: 2.1.5 - /usr/local/bin/composer
Homebrew: 3.2.6 - /usr/local/bin/brew
pip3: 19.2.3 - /usr/bin/pip3
RubyGems: 3.0.3 - /usr/bin/gem
Utilities:
Make: 3.81 - /usr/bin/make
GCC: 4.2.1 - /usr/bin/gcc
Git: 2.32.0 - /usr/local/bin/git
Clang: 12.0.5 - /usr/bin/clang
Servers:
Apache: 2.4.48 - /usr/sbin/apachectl
Virtualization:
Docker: 20.10.8 - /usr/local/bin/docker
IDEs:
Nano: 2.0.6 - /usr/bin/nano
Vim: 8.2 - /usr/bin/vim
Xcode: /undefined - /usr/bin/xcodebuild
Languages:
Bash: 3.2.57 - /bin/bash
Perl: 5.30.2 - /usr/bin/perl
PHP: 7.3.29 - /usr/bin/php
Python: 2.7.16 - /usr/bin/python
Python3: 3.8.2 - /usr/bin/python3
Ruby: 2.6.3 - /usr/bin/ruby
Databases:
SQLite: 3.32.3 - /usr/bin/sqlite3
Browsers:
Chrome: 93.0.4577.82
Safari: 14.1.2
The text was updated successfully, but these errors were encountered: