Error: Cannot find module 'webpack'错误解决

2023-05-25编程技术246066

$ npm install webpack -g

$ npm install webpack-cli -g
全局安装webpack $ npm run dev Error: Cannot find module 'webpack'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (E:\webpack\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
at Object.<anonymous> (E:\webpack\node_modules\webpack-cli\bin\convert-argv.js:7:24)
at Module._compile (E:\webpack\node_modules\v8-compile-cache\v8-compile-cache.js:178:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at yargs.parse (E:\webpack\node_modules\webpack-cli\bin\cli.js:241:14)
at Object.parse (E:\webpack\node_modules\yargs\yargs.js:567:18)
at E:\webpack\node_modules\webpack-cli\bin\cli.js:219:8
at Object.<anonymous> (E:\webpack\node_modules\webpack-cli\bin\cli.js:538:3)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at module.exports.filename (C:\Users\jinru\AppData\Roaming\npm\node_modules\webpack-cli\node_modules\import-local\index.js:16:66)
at C:\Users\jinru\AppData\Roaming\npm\node_modules\webpack-cli\bin\cli.js:13:6
at Object.<anonymous> (C:\Users\jinru\AppData\Roaming\npm\node_modules\webpack-cli\bin\cli.js:538:3)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
解决方法 $ npm link webpack
---------------------

  

Error: Cannot find module 'webpack'错误解决的相关教程结束。

本文地址:https://www.ufcn.cn/tutorials/2671827.html

如非特殊说明,本站内容均来自于网友自主分享,概不代表本站观点,如有任何问题我们都将在收到反馈后的第一时间进行处理!