一、问题:

    今天在运行vue项目时,在mac终端输入npm run dev,结果报错:

    

  翻译是:

    npm错误:缺少script:dev

    npm错误:完整路径见:users/mymac/ .npm/_logs/2018-09-17T08_50_26_450Z-debug.log

二、解决办法  

    1.打开相应的vue项目文件夹(我的项目名称是:my-project),打开package.json。

     

    

    2.发现:在script里,并没有dev,而是serve,应该用npm run serve命令运行vue项目。

    

  • 按照上面提示:本地地址是:localhost:8080,打开页面,成功运行啦!

npm run dev 报错:missing script:dev的更多相关文章

  1. npm run server报错

    从git上clone的vue项目npm install后npm run server报错 $ npm run dev > lufei@1.0.0 dev E:\pythonProject\luf ...

  2. 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 ...

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

    运行npm run eject报错解决方法 主要问题是脚手架添加.gitgnore文件,但是却没有本地仓库,使用以下命令操作以下就可以了 git init git add . git commit - ...

  4. vue中执行npm run build报错解决方法?

    遇到了执行npm run build 后报错: [build:js ] Module not found: Error: Can't resolve 'scss-loader' in 'D:\work ...

  5. 在package.json中配置Script执行npm run tslint报错问题

    今天在学习tslint的时候,按照git clone下angular2-webpack-starter的代码执行npm run lint时,虽然代码进行了检测,但检测完成后npm始终报错, //pac ...

  6. npm run build报错(npm ERR! code ELIFECYCLE)的解决办法

    具体报错如下图: 环境:centos7 应该node_modules安装问题,我们需要重新安装 rm -rf node_modules rm package-lock.json npm cache c ...

  7. 转载:TypeError: Cannot read property 'compilation' of undefined vue 打包运行npm run build 报错

    转载自:https://www.jianshu.com/p/3f8f60e01797 运行npm run build打包时,报错如下:   我的package.json如下: { ... " ...

  8. 使用create-react-app命令创建一个项目, 运行npm run eject报错

    解决方法: 先 git add . 然后 git commit -m ‘init’ 然后再npm run eject

  9. create-react-app 构建的项目使用释放配置文件 webpack 等等 运行 npm run eject 报错

    使用 git 提交一次记录即可正常 git add . git commit -m 'init' npm run eject

  10. vue2.x 在引用插件的时候,npm run dev跑正常 ,npm run build 报错vue-cli Unexpected token: punc (() [

    这是因为,引用的插件在node_modules里,并不在vue-cli的es6编译范围内,所以语法报错,修改方法:

随机推荐

  1. vue todolist 1.0

    <template> <div id="app"> <input type="text" v-model='todo' /> ...

  2. linux下开启某个端口的方法:可用于SQL

  3. C# Microsoft.Office不存在空间名称Interop和Excel

    在实际开发过程中,我们经常会对Excel表进行操作.相信大家都都已经很熟悉C#操作Excel的步骤:添加引用->COM->Microsoft Office Excel 11 Object. ...

  4. python re模块和collections

    re模块下的常用方法 import re ret = re.findall('a', 'eva egon yuan') # 返回所有满足匹配条件的结果,放在列表里 print(ret) #结果 : [ ...

  5. Android被忽略的tools

    自动生成的布局xml文件,很多都带有tools字样:但是大部分都被我们删除了: 其实它的作用是让我们这些开发者预览用的,十分的方便: 事例一个TextView: <TextView androi ...

  6. solr7.4 安装与使用

    1.solr7环境要求 solr7需要java8环境,且需要在环境变量中添加 JAVA_HOME变量. 2.solr 安装 下载地址 https://lucene.apache.org/solr/mi ...

  7. Spring 配置 Annotation <context:annotation-config> 和 <context:component-scan>标签的诠释及区别

    Spring 开启Annotation <context:annotation-config> 和 <context:component-scan>诠释及区别 <cont ...

  8. leetcode 852. Peak Index in a Mountain Array

    Input: [0,1,0] Output: 1 Input: [0,2,1,0] Output: 1解: 比较数组中的i和i-1的大小,如果前一位大于后一位数字,前一位则是结果 let ans = ...

  9. std::ios_base::fmtflags orig std::streamsize prec

  10. githup创建新java项目

    1.在githup中创建仓库 2.import创建的地址到本地文件d:/mygit 3.在d:/mygit中创建eclipse项目 3.在eclipse中team-->push to branc ...