npm run build报错 ,resolve is not defined
今天在build项目的时候报:
ReferenceError: resolve is not defined npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! yingyi@1.0.0 build: cross-env NODE_ENV=production webpack --progress --hide-modules
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the yingyi@1.0.0 build 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! C:UsersyingyiAppDataRoamingnpm-cache_logs2018-05-21T11_19_19_460Z-debug.log
查了一些文档发现是缺少辅助函数,在webpack的配置文件中加上就好了
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
使用vue-cli+webpack搭建的项目一般都有这个,如果是自己单引入的配置文件可能会报这个错,推荐使用脚手架工具搭建环境。
npm run build报错 ,resolve is not defined的更多相关文章
- 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 ...
- vue中执行npm run build报错解决方法?
遇到了执行npm run build 后报错: [build:js ] Module not found: Error: Can't resolve 'scss-loader' in 'D:\work ...
- npm run build报错(npm ERR! code ELIFECYCLE)的解决办法
具体报错如下图: 环境:centos7 应该node_modules安装问题,我们需要重新安装 rm -rf node_modules rm package-lock.json npm cache c ...
- 转载:TypeError: Cannot read property 'compilation' of undefined vue 打包运行npm run build 报错
转载自:https://www.jianshu.com/p/3f8f60e01797 运行npm run build打包时,报错如下: 我的package.json如下: { ... " ...
- 关于npm run build 报错解决方案
# 特定的错误 ERROR in statics/mobile/js/vendor.cef13a0e680a5bc0d8b3.js from UglifyJsUnexpected token: pun ...
- vue2.x 在引用插件的时候,npm run dev跑正常 ,npm run build 报错vue-cli Unexpected token: punc (() [
这是因为,引用的插件在node_modules里,并不在vue-cli的es6编译范围内,所以语法报错,修改方法:
- npm run build 报错 Error: No PostCSS Config found in...
module.exports = { plugins: [ require('autoprefixer')//自动添加css前缀 ] }; 在项目根目录新建postcss.config.js文件,添加 ...
- npm run build报错 No PostCSS Config found in
在项目根目录新建postcss.config.js文件,并对postcss进行配置: module.exports = { plugins: [ require('autoprefixer')//自动 ...
- 巨坑npm run dev 报错 终于找到正确答案 Error: EPERM: operation not permitted, open '/data/public/build/css/add.p
Windows10环境 npm run dev 报错 终于找到正确答案 Error: EPERM: operation not permitted, open '/data/public/build ...
随机推荐
- CentOS7 安装Maven3
下载安装文件 cd /root wget http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache- ...
- webapi 跨域访问设置基于jsonp跨域
JSONP实现跨域 Web API并没有提供JSONP Formatter,但是这并不能影响我们前进的脚步,我们可以自定义Formatter来实现JSONP功能.既然是利用JSONP跨域,那么就得简 ...
- schedule-pool模拟并行任务分片
模拟并行任务分片 代码部分: package com.pool; import com.alibaba.fastjson.JSON; import java.io.BufferedReader; im ...
- (转)在ASP.NET MVC3 中利用Jsonp跨域访问
原文地址:http://www.cnblogs.com/skm-blog/p/3431999.html 在信息系统开发的时,根据相关业务逻辑难免会多系统之间互相登录.一般情况下我们需要在多系统之间使用 ...
- 删除emacs临时文件
emacs编辑文件后产生的带小尾巴(~)的文件,你有没有强迫症,要删之而后快rm -rf *~ 你有没有不小心敲成了rm -rf ~,然后爽快的按下了回车,然后欲哭无泪,哈哈- 其实,可以设置在ema ...
- unittest测试框架详谈及实操(三)
断言 unittest的TestCase类提供了很多实用的方法来校验预期结果和程序返回的实际结果是否一致.当然这些方法要求必须满足某些条件才能继续执行接下的测试.大致有3种这样的方法.各覆盖一个特定类 ...
- Shell脚本中$0、$?、$!、$$、$*、$#、$@
1. $$Shell本身的PID(ProcessID) 2. $!Shell最后运行的后台Process的PID 3. $?最后运行的命令的结束代码(返回值) 4. $-使用Set命令设定的Flag一 ...
- C++ 调用C++写的函数库的2种方法之一(显式调用)
一:创建C++ DLL类库,名称:Dll1 1.Dll.h _declspec(dllimport) int add(int a, int b); 2.Dll.cpp // Dll.cpp : 定义 ...
- Raspberry Pi 3 安装 Lazarus 1.6.2(2017-02-09更新)
Raspberry Pi3 Lazarus 1.6.2 安装步骤如下: 安装环境:Raspbian Jessie, RPi3 1.安装subversion和unzip Sudo Apt-get upd ...
- linux网络NAT配置方式
NAT访问的权限如下: 外网不可以访问虚拟机,主机和虚拟机可以互访,网络和主机也可以互访: 1.打开虚拟机——编辑——虚拟网络编辑器——. 2. 3.进入虚拟机的linux系统点击网络 4. 5.点击 ...