最近在启动一个前端项目,执行npm install 一直失败 截图如下
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mall-admin-web@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mall-admin-web@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\zhanghailang\AppData\Roaming\npm-cache\_logs\2021-01-19T01_37_05_723Z-debug.log
E:\ideaProject\mall-admin-web>npm install
npm WARN tarball tarball data for cosmiconfig@2.2.2 (sha512-GiNXLwAFPYHy25XmTPpafYvn3CLAkJ8FLsscq78MQd1Kh0OU6Yzhn4eV2MVF4G9WEQZoWEGltatdR+ntGPMl5A==) seems to be corrupted. Trying one more time.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.3 (node_modules\fsevents):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'E:\ideaProject\mall-admin-web\node_modules\.staging\fsevents-d5fcd79c\node_modules\abbrev' -> 'E:\ideaProject\mall-admi
n-web\node_modules\.staging\abbrev-3b6ed647'
npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path E:\ideaProject\mall-admin-web\node_modules\.staging\cosmiconfig-6b2845e1\README.md
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink 'E:\ideaProject\mall-admin-web\node_modules\.staging\cosmiconfig-6b2845e1\README.md'
npm ERR! [OperationalError: EPERM: operation not permitted, unlink 'E:\ideaProject\mall-admin-web\node_modules\.staging\cosmiconfig-6b2845e1\README.md'] {
npm ERR! cause: [Error: EPERM: operation not permitted, unlink 'E:\ideaProject\mall-admin-web\node_modules\.staging\cosmiconfig-6b2845e1\README.md'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'E:\\ideaProject\\mall-admin-web\\node_modules\\.staging\\cosmiconfig-6b2845e1\\README.md'
npm ERR! },
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'E:\\ideaProject\\mall-admin-web\\node_modules\\.staging\\cosmiconfig-6b2845e1\\README.md',
npm ERR! parent: 'mall-admin-web'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm WARN tarball tarball data for colors@1.1.2 (sha1-FopHAXVran9RoSzgyXv6KMCE7WM=) seems to be corrupted. Trying one more time.
npm WARN tarball tarball data for merge-options@0.0.64 (sha1-y+BPWUppheryf3+PCyo6z2+dVi0=) seems to be corrupted. Trying one more time.
npm WARN tarball tarball data for autoprefixer@6.7.7 (sha1-Hb0cg1ZY41zj+ZhAmdsAWFx4IBQ=) seems to be corrupted. Trying one more time.
npm ERR! A complete log of this run can be found in:
解决办法 删除项目下如下文件夹
在项目控制台执行cnpm install
启动 cnpm run dev