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 ...
随机推荐
- windows与linux的文件路径
在windows操作系统中,文件路径的分隔符是反斜杠(“\\”),例如: E:\\hsta\\pdf(这里为防止转义,所以要写成两个反斜杠) 但是在linux操作系统中,文件的分隔符是斜杠(“/”), ...
- SpringBoot常用注解解析
@RestController 将返回的对象数据直接以 JSON 或 XML 形式写入 HTTP 响应(Response)中.绝大部分情况下都是直接以 JSON 形式返回给客户端,很少的情况下才会以 ...
- Tensorflow机器学习入门——ModuleNotFoundError: No module named 'tensorflow.keras'
这个bug的解决办法: # from tensorflow.keras import datasets, layers, models from tensorflow.python.keras imp ...
- 【C++初学者自学笔记二】函数重载(模块一)
1.概念:同意作用域的一组参数列表不同,函数名相同的函数,这组函数叫函数重载(C语言是不能定义相同名称的函数,但是C++可以允许定义). 2作用:重载函数通常来命名一组功能相似的函数,这样做减少了函数 ...
- swiper选项卡还可以左右滑动,最后一个直接跳转链接
整理分享: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf ...
- Eclipse开发快捷键
ctrl+alt+r:查找资源 ctrl+o:快速outLine ctrl+e:快速切换编辑器 ctrl+./ctrl+1:下一个错误修改
- vs2013 SQLite数据库增删改查
代码:Database2.7z Database.h: #pragma once #include<string> #include<vector> #include<W ...
- vmware 因误删Linux 虚拟机磁盘,无法启动处理方法
有可能我们在做了以下误操作,导致Linux系统无法启动: 1). 磁盘损坏或虚拟机磁盘被我们删除了,而fstab文件没有更新: 2). 由于误操作或其它原因使动态库错误. 1. 首先准备好系统安装盘, ...
- 捣鼓FileZilla
今天突然对ftp服务器感兴趣,于是随意打了一个ftp词条,发现了FZ官网,好奇点进去下载了之后,捣鼓了一会.于是,也写一个小教程记录一下吧,害怕自己以后忘记怎么弄的了. 首先需要用到两个,一个是FZ ...
- 若块级元素被设置为 display: table-cell 便无法设置宽度
工作中,遇到表格的单元格中的 div 设置宽度无效,后来是发现 div 被设置为 display: table-cell ,后将其修改为 display: block 则设置的宽度生效.