最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Weird error after updating package.json of old project - Stack Overflow

programmeradmin0浏览0评论

Updated the packages.json of a old project to work on it and get this weird error. I don't even know what the issue is here. Any help is appreciated!

Compiled with problems:

ERROR in ./node_modules/@babel/runtime/helpers/esm/inherits.js 1:0-46

Module not found: Error: Can't resolve './setPrototypeOf' in 'C:\Users--\Desktop\Lowkey Meal - React\client\node_modules@babel\runtime\helpers\esm' Did you mean 'setPrototypeOf.js'? BREAKING CHANGE: The request './setPrototypeOf' failed to resolve only because it was resolved as fully specified (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request.

ERROR in ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js 1:0-46

Module not found: Error: Can't resolve './defineProperty' in 'C:\Users--\Desktop\Lowkey Meal - React\client\node_modules@babel\runtime\helpers\esm' Did you mean 'defineProperty.js'? BREAKING CHANGE: The request './defineProperty' failed to resolve only because it was resolved as fully specified (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request.

ERROR in ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js 1:0-74

Module not found: Error: Can't resolve './objectWithoutPropertiesLoose' in 'C:\Users--\Desktop\Lowkey Meal - React\client\node_modules@babel\runtime\helpers\esm' Did you mean 'objectWithoutPropertiesLoose.js'? BREAKING CHANGE: The request './objectWithoutPropertiesLoose' failed to resolve only because it was resolved as fully specified (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request.

Updated the packages.json of a old project to work on it and get this weird error. I don't even know what the issue is here. Any help is appreciated!

Compiled with problems:

ERROR in ./node_modules/@babel/runtime/helpers/esm/inherits.js 1:0-46

Module not found: Error: Can't resolve './setPrototypeOf' in 'C:\Users--\Desktop\Lowkey Meal - React\client\node_modules@babel\runtime\helpers\esm' Did you mean 'setPrototypeOf.js'? BREAKING CHANGE: The request './setPrototypeOf' failed to resolve only because it was resolved as fully specified (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request.

ERROR in ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js 1:0-46

Module not found: Error: Can't resolve './defineProperty' in 'C:\Users--\Desktop\Lowkey Meal - React\client\node_modules@babel\runtime\helpers\esm' Did you mean 'defineProperty.js'? BREAKING CHANGE: The request './defineProperty' failed to resolve only because it was resolved as fully specified (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request.

ERROR in ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js 1:0-74

Module not found: Error: Can't resolve './objectWithoutPropertiesLoose' in 'C:\Users--\Desktop\Lowkey Meal - React\client\node_modules@babel\runtime\helpers\esm' Did you mean 'objectWithoutPropertiesLoose.js'? BREAKING CHANGE: The request './objectWithoutPropertiesLoose' failed to resolve only because it was resolved as fully specified (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request.

Share Improve this question asked Jan 10, 2022 at 5:30 rody401rody401 1091 silver badge5 bronze badges 4
  • What do you mean when you say you "updated package.json"? – Nathan Wiles Commented Jan 10, 2022 at 5:31
  • @NathanWiles Updated all the dependencies to the latest versions – rody401 Commented Jan 10, 2022 at 14:50
  • @rody401 I am having the same problems, I think it has to do with patibility of the packages, but have not figured out how to solve it yet. – Sachihiro Commented Feb 13, 2022 at 11:18
  • Having the same issue. Any update? @Sachihiro – Sajjad Shahi Commented Mar 2, 2022 at 22:41
Add a ment  | 

2 Answers 2

Reset to default 3

Had similar problem when upgrading my package.json with create-react-app 5.0.0.

I'd already tried deleting node-modules and re-doing the npm install but it didn't work.

The trick was to delete node_modules AND package-lock.json before doing the npm install. After that the build worked fine.

Just type in terminal --> npm i --> press Enter Required module is not installed and after running this mand all the required module will be installed automatically.

发布评论

评论列表(0)

  1. 暂无评论