npm安装依赖报错npm ERR! code ENOTFOUND npm ERR! errno ENOTFOUND_得我所得,爱我所爱的博客-CSDN博客npm安装依赖报错今天在学习webpack的时候,在使用npm install来安装一个局部的webpack时候,报出一下错误:npm ERR! code ENOTFOUNDnpm ERR! errno ENOTFOUNDnpm ERR! network request to http://registry.cnpmjs.org/webpack failed, reason: getaddrinfo ENOTFOUND proxy-sznnpm ERR! network This is a pro_npm err! code enotfoundhttps://blog.csdn.net/qq_45914170/article/details/112298654
C:\Users\8\Desktop\CS5\client_admin>npm run dev报错:
> changsheng_project_admin@0.1.0 dev C:\Users\8\Desktop\CS5\client_admin
> vue-cli-service serveINFO Starting development server...
98% after emitting CopyPluginERROR Failed to compile with 1 error 12:43:36 AMerror in ./src/main.jsSyntax Error: BrowserslistError: [BABEL] C:\Users\8\Desktop\CS5\client_admin\src\main.js: C:\Users\8\Desktop\CS5\client_admin contains both .browserslistrc and browserslist (While processing: "C:\\Users\\8\\Desktop\\CS5\\client_admin\\node_modules\\@vue\\cli-plugin-babel\\preset.js")at Generator.next (<anonymous>)at Generator.next (<anonymous>)@ multi (webpack)-dev-server/client?http://10.34.187.254:8081&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
这是一个关于 Vue.js 项目的错误信息,可能是由于项目中的 .browserslistrc 和 browserslist 文件冲突导致的。可以尝试删除其中一个文件或将其合并为一个文件来解决此问题。另外,也可以尝试更新您的 Babel 和 Vue CLI 版本以获得更好的兼容性。
我就是删除了browserslist文件,运行结果如下:
C:\Users\8\Desktop\CS5\client_admin>npm run dev> changsheng_project_admin@0.1.0 dev C:\Users\8\Desktop\CS5\client_admin
> vue-cli-service serveINFO Starting development server...
10% building 4/5 modules 1 active ...r\lib\index.js!C:\Users\8\Desktop\CS5\client_admin\src\main.jsBrowserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-dbWhy you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
68% building 604/619 modules 15 active ...0220331154246\client_admin\node_modules\core-js\modules\es.string.iterator.js[BABEL] Note: The code generator has deoptimised the styling of C:\Users\8\Desktop\CS5\client_admin\src\assets\js\echarts.min.js as it exceeds the max of 500KB.
98% after emitting CopyPluginWARNING Compiled with 1 warning 12:49:49 AMwarning in ./src/components/common/page_side.vue?vue&type=template&id=230c6473&scoped=true&Module Warning (from ./node_modules/vue-loader/lib/loaders/templateLoader.js):
(Emitted value instead of an instance of Error) <el-menu-item v-for="o in auth">: component lists rendered with v-for should have explicit keys. See https://vuejs.org/guide/list.html#key for more info.@ ./src/components/common/page_side.vue?vue&type=template&id=230c6473&scoped=true& 1:0-438 1:0-438@ ./src/components/common/page_side.vue@ ./src/plugins/component.js@ ./src/plugins/index.js@ ./src/main.js@ multi (webpack)-dev-server/client?http://10.34.187.254:8082&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.jsApp running at:- Local: http://localhost:8082/- Network: http://10.34.187.254:8082/Note that the development build is not optimized.To create a production build, run npm run build.