困扰了我两天的错误!!!
由于我是重装系统了,想给文件夹名称整顿一下,结果启动vue项目后报错了

npm run dev

先把错误贴上来,这里用xxx代替项目名称

D:\Workspace\WorkSpace&Web\xxx>npm run dev

> xxx@1.0.0 dev D:\Workspace\WorkSpace&Web\xxx
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

'Web\xxx\node_modules\.bin\' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
internal/modules/cjs/loader.js:905
  throw err;
  ^

Error: Cannot find module 'D:\Workspace\webpack-dev-server\bin\webpack-dev-server.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! xxx@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 xxx@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!     D:\Environments\NodeJs\node_cache\_logs\2021-07-07T07_11_38_842Z-debug.log

在网上找了很久,都没有解决方法
最后才发现,文件夹名称不能有 & !!!

有没有发现下面的&是高亮了,吃一堑长一智,以后文件夹命名再也不花里胡哨了!

D:\Workspace\WorkSpace&Web\xxx>npm run dev
Logo

前往低代码交流专区

更多推荐