webpack 4.X npm run start 报错

package.json:

{
  "name": "webpack",
  "version": "1.0.0",
  "description": "",
  "main": "webpack.config.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "webpack",
    "start": "webpack-dev-server"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "jquery": "^3.3.1"
  },
  "devDependencies": {
    "webpack-dev-server": "^3.1.5"
  }
}

bogon:webpack cristin$ npm run start

> [email protected] start /Users/cristin/Documents/webpack
> webpack-dev-server

module.js:487
throw err;
^

Error: Cannot find module ‘webpack‘
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/cristin/Documents/webpack/node_modules/webpack-dev-server/lib/Server.js:22:17)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `webpack-dev-server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start 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! /Users/cristin/.npm/_logs/2018-07-23T03_08_57_715Z-debug.log
bogon:webpack cristin$ sudo npm install webpack-dev-server
Password:
npm WARN [email protected] requires a peer of [email protected]^4.0.0-beta.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected]^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
updated 2 packages in 12.044s
bogon:webpack cristin$

原文地址:https://www.cnblogs.com/cristin/p/9353656.html

时间: 2024-10-14 17:40:51

webpack 4.X npm run start 报错的相关文章

npm run dev报错,events.js:160 throw er; // Unhandled &#39;error&#39; event

错误代码如下: [email protected] dev E:MySoftwaretestGitwebpackvue-projectnode build/dev-server.js "8088" events.js:160 throw er; // Unhandled 'error' event ^ Error: listen EACCES 0.0.0.0:8080 at Object.exports._errnoException (util.js:1026:11) at expo

npm run server报错

从git上clone的vue项目npm install后npm run server报错 $ npm run dev > [email protected] dev E:\pythonProject\luffy\luffyvue > webpack-dev-server --inline --progress --config build/webpack.dev.conf.js 10% building modules 0/1 modules 1 active ... webpack/hot/

vue项目npm run dev报错events.js:160 throw er; // Unhandled &#39;error&#39; event listen EADDRINUSE :::8002

出错情况,如下图: 报错原因: listen EADDRINUSE :::8002 意思是当前8002端口被占用 解决办法: 一:简单粗暴:关掉可能影响的相关程序,重新执行启动. 二: 1.Win+R,cmd查询使用的端口号是否被占用: 输入命令:netstat -aon|findstr "8002" 按回车显示占用8080端口对应的程序的PID号:如下图: 2.根据PID号找到对应的程序: 输入命令:tasklist|findstr "12452" 按回车后显示出

vue-electron 使用sqlite3数据库,执行npm run build 报错 .NET Framework 2.0 SDK,Microsoft Visual Studio 2005[C:\temp\wechat\node_modules\sqlite3\build\binding.sln]

问题描述 vue-electron 使用sqlite3数据库,执行npm run build 报错如下: .NET Framework 2.0 SDK,Microsoft Visual Studio 2005[C:\temp\wechat\node_modules\sqlite3\build\binding.sln]Failed to execute 'C:\Program Files (x86)\nodejs\node.exe C:\Program Files (x86)\nodejs\nod

解决npm run eject报错问题

creat-react-app npm run eject报错问题 使用creat-react-app 初始化项目后,运行npm run eject会暴露出隐藏的配置文件, 但是直接使用npm run eject命令的话又会报错... 这样 或是这样 百思不得解呀,扒了好久终于知道咋办了 create-react-app my-app 后 依次执行以下命令 git init git add . git commit -m "Saving before ejecting" 然后再执行 n

create-react-app创建项目后,运行npm run eject报错解决方法

运行npm run eject报错解决方法 主要问题是脚手架添加.gitgnore文件,但是却没有本地仓库,使用以下命令操作以下就可以了 git init git add . git commit -m 'saveing befor ejecting' 最后 npm run eject y 就解决了! 原文地址:https://www.cnblogs.com/ZhaoWeiNotes/p/11855731.html

nuxt.js 初始化 npm run dev 报错

在初始化 npm install 了基本依赖后: npm run dev 报错: error in ./server/index.js Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions. In C:\Users\L\Desktop\Nuxt\nuxt-learn\node_modules\backpack-core\babel.js at create

vue 运行npm run dev报错

npm run dev运行时报错,原因有很多. 一般用下面这种方法都能解决的. 最简单粗暴的方法: 1.删除依赖包node_modules 2.然后重新npm install就行了 (如果这步报错了,试试cnpm install) 原文地址:https://www.cnblogs.com/Mrrabbit/p/8619188.html

npm run dev 报错 run `npm audit fix` to fix them, or `npm audit` for details

前几天写的直接运行npm run dev还是ok的,突然不行了,前面报错是css-loader没有,删除style标签上的lang='scss'就好了,先不需要这个依赖.这个先不管. 只是后面的 run `npm audit fix` to fix them, or `npm audit` for details,来回依据指令好几次,依然是这样.... 解决:运行 npm audit fix --force..npm install..貌似解决了 原文地址:https://www.cnblogs