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 createDescriptor (C:\Users\L\Desktop\Nuxt\nuxt-learn\node_modules\@babel\core\lib\config\config-descriptors.js:178:11)
at C:\Users\L\Desktop\Nuxt\nuxt-learn\node_modules\@babel\core\lib\config\config-descriptors.js:109:50
at Array.map (<anonymous>)
at createDescriptors (C:\Users\L\Desktop\Nuxt\nuxt-learn\node_modules\@babel\core\lib\config\config-descriptors.js:109:29)
at createPresetDescriptors (C:\Users\L\Desktop\Nuxt\nuxt-learn\node_modules\@babel\core\lib\config\config-descriptors.js:101:10)
at C:\Users\L\Desktop\Nuxt\nuxt-learn\node_modules\@babel\core\lib\config\config-descriptors.js:58:96
at cachedFunction (C:\Users\L\Desktop\Nuxt\nuxt-learn\node_modules\@babel\core\lib\config\caching.js:32:19)
at presets (C:\Users\L\Desktop\Nuxt\nuxt-learn\node_modules\@babel\core\lib\config\config-descriptors.js:29:84)
at mergeChainOpts (C:\Users\L\Desktop\Nuxt\nuxt-learn\node_modules\@babel\core\lib\config\config-chain.js:320:26)
at C:\Users\L\Desktop\Nuxt\nuxt-learn\node_modules\@babel\core\lib\config\config-chain.js:283:7 internal/modules/cjs/loader.js:797
throw err;
^ Error: Cannot find module 'C:\Users\L\Desktop\Nuxt\nuxt-learn\build\main.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
at internal/main/run_main_module.js:17:11 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
初始化的 依赖中 版本都比较旧,只需将下面红色部分版本手动升级即可。
{
"name": "nuxt-learn",
"version": "1.1.0",
"description": "Nuxt.js project",
"author": "Xuhua <1729792587@qq.com>",
"private": true,
"scripts": {
"dev": "backpack dev",
"build": "nuxt build && backpack build",
"start": "cross-env NODE_ENV=production node build/main.js",
"precommit": "npm run lint",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore ."
},
"dependencies": {
"cross-env": "^5.0.1",
"koa": "^2.4.1",
"nuxt": "latest",
"source-map-support": "^0.4.15"
},
"devDependencies": {
"babel-eslint": "^7.1.1",
"backpack-core": "^0.8.4",
"eslint": "^3.19.0",
"eslint-config-standard": "^10.2.1",
"eslint-loader": "^2.1.1",
"eslint-plugin-html": "^2.0.3",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-node": "^4.2.2",
"eslint-plugin-promise": "^3.4.0",
"eslint-plugin-standard": "^3.0.1",
"nodemon": "^1.11.0",
"scmp": "^2.0.0"
}
}
nuxt.js 初始化 npm run dev 报错的更多相关文章
- vue项目初始化时npm run dev报错webpack-dev-server解决方法
vue项目初始化时npm run dev报错webpack-dev-server解决方法 原因:这是新版webpack存在的BUG,卸载现有的新版本webpack,装老版本就好webpack-dev- ...
- 巨坑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 ...
- npm run dev 报错 iview TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
运行npm run dev报这个错 然后找到 D:\text\vue\iview-admin\build\webpack.dev.config.js打开 将这一行代码: fs.write(fd, bu ...
- Vue 项目: npm run dev 报错 webpack-dev-server
从码云上下载vue项目,运行npm run dev 时报错: > webpack-dev-server --inline --progress --config build/webpack.de ...
- npm run dev 报错:Error: Cannot find module 'webpack-cli/bin/config-yargs'
使用 npm run dev 时报错: Error: Cannot find module 'webpack-cli/bin/config-yargs' 原因是找不到webpack-cli这个包,使用 ...
- vue.js环境配置步骤及npm run dev报错解决方案
安装完成后,使用npm run dev 运行,成功后,就可以在浏览器中看到vue的欢迎画面了 最后一步可能报错,我就遇到这样的问题了, 个人问题仅供参考: ERROR Failed to compil ...
- vue npm run dev 报错 semver\semver.js:312 throw new TypeError('Invalid Version: ' + version)
npm run dev运行报错信息如下图: 原因分析: 版本问题 解决办法: 在semver.js(node_modules/semver/semver.js)里做了一些改动,代码如下: // if ...
- vue项目npm run dev 报错error in ./src/main.js Module build failed: Error: Cannot find module 'babel-plugin-syntax-jsx'
问题: vue 项目npm run dev运行时报错,如下图: 原因: 缺少相应的组件 解决办法: 安装相应组件: npm install babel-plugin-syntax-jsx --sav ...
- vue项目npm run dev 报错error in ./src/main.js Module build failed: ReferenceError: Unknown plugin "transform-vue-jsx" specified in......
问题: vue项目npm run dev运行时报错,如下图: 原因: 缺少组件 解决办法: 安装相应的组件: npm install babel-plugin-transform-vue-jsx ...
随机推荐
- jquery 判定checkbox是否选中
CheckBox 判定是否选中 使用 attr('checked')来做判别是不行的,除非所有的选中取消都是使用这个属性来处理. 正确的做法是使用 .prop('checked') 来判定.
- log4j2 异步多线程打印日志
log4j2 异步多线程打印日志 Maven依赖 <dependency> <groupId>org.apache.logging.log4j</groupId> ...
- 使用外网访问Flask项目
在学习flask过程中,想使用手机访问项目,根据flask手册中可以将 app.run(host='192.168.1.109', port=8000,debug=True) 但是发现手机依然无法连接 ...
- TCP通讯代码
服务端代码: import socket server_socket=socket.socket(socket.AF_INET,socket.SOCK_STREAM) # 使用固定端口 server_ ...
- windows系统下hosts文件的改写(为了测试nginx内网的证书代理,需要做域名解析)
1. win加R C:\WINDOWS\system32\drivers\etc 2.打开hosts文件 加入一行 IP为客户机要访问的IP地址 域名也是在nginx中定义好的 3.ct ...
- js里用 toLocaleString 实现给数字加三位一逗号间隔(有无小数点都适用)
<input type="hidden" id="totalLandArea" value="<%-info.totalLandArea% ...
- C/C++ — CreateThread 相关 API
使用互斥对象: #include <windows.h> #include <iostream> #define THREADCOUNT 6 HANDLE ghMutex; D ...
- vue-mixin
当多个组件需要处理同一个问题,并且处理该问题的逻辑又相似,非常推荐用mixin
- 「luogu1613」跑路
传送门 Luogu 解题思路 对于所有可以用 \(2^k\) 形式表示的 \(dis(i,j)\),将\(i,j\)之间的 \(dis\) 置为 \(1\),可以用倍增 \(\text{Floyd}\ ...
- Github 第三方授权登录教程
Github 第三方授权登录教程 ####大致流程图 ####1.首先注册一个github帐号,Applications>Developer applications>Register a ...