admin管理员组文章数量:1332708
I've been having this problem recently that nothing related to npm is working for me except npm start
.
npm install
is giving this error:
$ npm install @material-ui/core npm ERR! Object for dependency "@babel/generator" is empty. npm ERR! Something went wrong. Regenerate the package-lock.json with "npm install". npm ERR! If using a shrinkwrap, regenerate with "npm shrinkwrap". npm ERR! A plete log of this run can be found in: npm ERR! C:\Users\Parth\AppData\Roaming\npm-cache\_logs\2020-08-20T13_52_13_701Z-debug.log
npx create-react-app ./
is giving this error:
npx create-react-app ./ npx: installed 98 in 10.023s Creating a new React app in G:\hel. Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts with cra-template... yarn add v1.22.4 [1/4] Resolving packages... [2/4] Fetching packages... error An unexpected error occurred: "UNKNOWN: unknown error, unlink 'C:\\Users\\Parth\\AppData\\Local\\Yarn\\Cache\\v6\\npm-core-js-pure-3.6.4-4bf1ba866e25814f149d4e9aaa08c36173506e3a-integrity\\node_modules\\core-js-pure\\features\\object\\is-frozen.js'". info If you think this is a bug, please open a bug report with the information provided in "G:\\hel\\yarn-error.log". info Visit for documentation about this mand. Aborting installation. yarnpkg add --exact react react-dom react-scripts cra-template --cwd G:\hel has failed. Deleting generated file... package.json Deleting generated file... yarn.lock Done.
EDIT: So I tried using Yarn for my installs but got this error:
$ yarn add @material-ui/core yarn add v1.22.4 warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json. [1/4] Resolving packages... [2/4] Fetching packages... error An unexpected error occurred: "UNKNOWN: unknown error, unlink 'C:\\Users\\Parth\\AppData\\Local\\Yarn\\Cache\\v6\\npm-core-js-pure-3.6.4-4bf1ba866e25814f149d4e9aaa08c36173506e3a-integrity\\node_modules\\core-js-pure\\features\\object\\is-frozen.js'". info If you think this is a bug, please open a bug report with the information provided in "F:\\Parth\\covid-19-tracker\\yarn-error.log". info Visit for documentation about this mand.
How do I fix this?
Edit: My version of npm
is 6.14.8
I've been having this problem recently that nothing related to npm is working for me except npm start
.
npm install
is giving this error:
$ npm install @material-ui/core npm ERR! Object for dependency "@babel/generator" is empty. npm ERR! Something went wrong. Regenerate the package-lock.json with "npm install". npm ERR! If using a shrinkwrap, regenerate with "npm shrinkwrap". npm ERR! A plete log of this run can be found in: npm ERR! C:\Users\Parth\AppData\Roaming\npm-cache\_logs\2020-08-20T13_52_13_701Z-debug.log
npx create-react-app ./
is giving this error:
npx create-react-app ./ npx: installed 98 in 10.023s Creating a new React app in G:\hel. Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts with cra-template... yarn add v1.22.4 [1/4] Resolving packages... [2/4] Fetching packages... error An unexpected error occurred: "UNKNOWN: unknown error, unlink 'C:\\Users\\Parth\\AppData\\Local\\Yarn\\Cache\\v6\\npm-core-js-pure-3.6.4-4bf1ba866e25814f149d4e9aaa08c36173506e3a-integrity\\node_modules\\core-js-pure\\features\\object\\is-frozen.js'". info If you think this is a bug, please open a bug report with the information provided in "G:\\hel\\yarn-error.log". info Visit https://yarnpkg./en/docs/cli/add for documentation about this mand. Aborting installation. yarnpkg add --exact react react-dom react-scripts cra-template --cwd G:\hel has failed. Deleting generated file... package.json Deleting generated file... yarn.lock Done.
EDIT: So I tried using Yarn for my installs but got this error:
$ yarn add @material-ui/core yarn add v1.22.4 warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json. [1/4] Resolving packages... [2/4] Fetching packages... error An unexpected error occurred: "UNKNOWN: unknown error, unlink 'C:\\Users\\Parth\\AppData\\Local\\Yarn\\Cache\\v6\\npm-core-js-pure-3.6.4-4bf1ba866e25814f149d4e9aaa08c36173506e3a-integrity\\node_modules\\core-js-pure\\features\\object\\is-frozen.js'". info If you think this is a bug, please open a bug report with the information provided in "F:\\Parth\\covid-19-tracker\\yarn-error.log". info Visit https://yarnpkg./en/docs/cli/add for documentation about this mand.
How do I fix this?
Edit: My version of npm
is 6.14.8
- You use yarn or npm?? – Aravinda Meewalaarachchi Commented Aug 20, 2020 at 14:11
- I always use npm but after getting this error multiple times i tried yarn and it didn't work either. – Parth Commented Aug 20, 2020 at 14:13
2 Answers
Reset to default 6First of all you need to make sure that your node and npm versions are up to date. if not please upgrade your node and npm packages to latest versions.
nvm install 12.18.3 // update node version through node version manager
npm install npm // update your npm version to latest
Delete your node_modules
folder, package-lock.json
and yarn
file (if you have).
Force clean the entire NPM cache by using following and.
npm cache clean --force
Re-Install all the dependencies.
npm install
If above step didn't resolve your problem, try to uninstall yarn
globally by delete the Yarn
folder from global folder and then run.
npm uninstall -g yarn
I met this problem after I tried to delete node_module
unseccessfully.
It didn't let me delete the rest of that directory, even part of it.
from the file explirer I tried to delete, to remove - with no help
So I renamed the directory (this is the only action left to do..) and then ran npm install
that fixed the problem
本文标签: javascriptnpm related tasks are throwing errors during installationsStack Overflow
版权声明:本文标题:javascript - npm related tasks are throwing errors during installations - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742244644a2439050.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论