遇到internal/modules/cjs/loader.js:584 throw err; ^ Error: Cannot find module 'unpipe'錯誤方法

PS H:\Vue代碼\day6\02.webpack-vue1> npm run dev

> [email protected] dev H:\Vue代碼\day6\02.webpack-vue1
> webpack-dev-server --open --port 3000 --contentBase src --hot

internal/modules/cjs/loader.js:584
    throw err;
    ^

Error: Cannot find module 'unpipe'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
    at Function.Module._load (internal/modules/cjs/loader.js:508:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (H:\Vue代碼\day6\02.webpack-vue1\node_modules\[email protected]@finalhandler\index.js:20:14)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: `webpack-dev-server --open --port 3000 --contentBase src --hot`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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!     D:\可視化內容軟件\nodejs\node_cache\_logs\2019-11-30T12_09_26_238Z-debug.log

錯誤信息如上,一開始報的錯誤是

'webpack-dev-server' is not recognized as an internal or external command,

我還納悶,不是安裝過webpack-dev-server麼,爲何不識別,然後我又安裝一遍發現報的就是上面這個584錯誤,解決方法如下:
1、強制永久刪除node_modules文件夾,只是點刪除就說需要管理員權限
在這裏插入圖片描述
2、輸入命令 npm install即可

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章