Comments (43)
@CurryHan 这个是语法错误诶,你再当前文档项目进行 npm install
看一下有问题没有
from rdoc.
@CurryHan 我测试一下, 你是在运行哪一步出错了呢?
from rdoc.
@CurryHan 我重现了你的过程,你需要进入 rdoc
生成的文档项目, 安装依赖(npm install
),即可解决问题。
from rdoc.
@jaywcjlove 我试了下还是不行。
from rdoc.
@CurryHan 你看一下你的 package.json
中依赖是不是空的, 如果是空的添加下面内容。可能我要更新一下初始化实例呢,你的 rodc
什么版本呢?
{
"dependencies": {
"rdoc": "1.3.x"
}
}
from rdoc.
有依赖的
{
"name": "NDocs",
"version": "1.0.0",
"description": "Describe NDocs here",
"private": true,
"scripts": {
"deploy": "rdoc --publish <your repo url>",
"build": "rdoc -d home,introduce,faq,about,github --clean --build",
"start": "rdoc -d home,introduce,faq,about,github --clean"
},
"keywords": [
"NDocs",
"rdoc",
"react-doc",
"react"
],
"dependencies": {
"rdoc": "1.3.x"
},
"author": "",
"license": "MIT"
}
from rdoc.
你删除node_modules
目录,重新npm install
然后npm run start
跑一下试一试,看有问题没有,看运行报什么错误哦呢?
from rdoc.
使用install
然后build、或者start都不行?不知什么问题
`D:\Users\xiaoymin\code\practice\rdoc_stu>npm run build
[email protected] build D:\Users\xiaoymin\code\practice\rdoc_stu
rdoc -d home,introduce,faq,about,github --clean --build
◞ Creating an optimized production build...(node:11508) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ./node_modules/rdoc/src/web/Router.js
Module parse failed: Unexpected token (12:43)
You may need an appropriate loader to handle this file type.
| if (!arr || arr.length === 0) return false;
| const index = arr.filter(item => item.name === 'README.md' && item.mdconf);
| if (index && index.length > 0) props = { ...index[0] };
| return props;
| }
(node:11508) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
◠ Creating an optimized production build...
`
from rdoc.
@jaywcjlove 跟这位兄弟@xiaoymin 报错一样的。
from rdoc.
@CurryHan 这个是要升级到 node 8.9.4 ?
from rdoc.
目前我本机安装的是node 8.9.3 要升级到8.9.4吗?@jaywcjlove
from rdoc.
from rdoc.
@xiaoymin 我那个windows测试一下
from rdoc.
刚才在 windows 7
下面测试成功了
中间有一个重要环节就是 npm install rdoc -g
安装成功,如果失败了 npm uninstall rdoc -g
卸载了重装。
node v9.1.0
npm v5.5.1
rdoc init my-project
重新初始化项目
cd my-project
进入项目
npm run start
我成功了!
from rdoc.
@jaywcjlove 一样的哦
重装了node,升级版本到v9.1.0
卸载了rdoc,重新install 安装
还是一样的错
`
Starting the development server...
Failed to compile.
./node_modules/rdoc/src/web/Router.js
Module parse failed: Unexpected token (12:43)
You may need an appropriate loader to handle this file type.
| if (!arr || arr.length === 0) return false;
| const index = arr.filter(item => item.name === 'README.md' && item.mdconf);
| if (index && index.length > 0) props = { ...index[0] };
| return props;
| }
`
from rdoc.
@xiaoymin 你是什么操作系统呢?不应该啊,这个是 babel配置,
你重新 rdoc init my-project
一个项目呢?
from rdoc.
@jaywcjlove win 10 专业版
from rdoc.
我win 7也不行啊
from rdoc.
@xiaoymin rdoc
版本是几多呢?
from rdoc.
@jaywcjlove 怎么看rdoc的版本。?
from rdoc.
@xiaoymin 尴尬了,还没有这个命令....
我测试了 node v8.9.3 也没有问题,好尴尬,你重新安装rdoc
npm install -g rdoc # 确保安装正确,没有报 error
rdoc init my-project # 初始化工程目录 my-project 以及初始化文件
cd my-project # 进入新的文档工程目录中
npm run start # 启动服务
from rdoc.
我猜是安装 rdoc 工具没有成功,node 重新安装要重启电脑?
from rdoc.
@jaywcjlove 不用重启吧?环境变量 配置都生效 了 啊
from rdoc.
同样这个问题,在windows10, Debian, termux, 均出错,nodejs 8.9.4版本
from rdoc.
@whywilson @xiaoymin @CurryHan
更新 [email protected]
之前开发模式没有发现,测试也是开发模式测试,依赖缺失......
from rdoc.
router.js依然报错,错误日志不变
from rdoc.
@whywilson ...
我再测试测试,你什么平台 rdoc 卸载干净了没有 Mac上有可能 跟系统自带的 ruby 文档工具 rdoc冲突...
from rdoc.
router.js 同样的错误
from rdoc.
@ByMorata Windows 上面?
from rdoc.
@jaywcjlove 单独的VPS,全新的环境
node v9.1.0
npm v5.5.1
还是一样的错误阿,就是语法问题吗?
from rdoc.
@ByMorata 问题我在调试,克隆到本地npm link
安装,没有问题, npm install -g rdoc
运行就报语法错误。
from rdoc.
更新 [email protected]
这个问题解决了
from rdoc.
这次真的解决了😆
@whywilson @xiaoymin @CurryHan
from rdoc.
@jaywcjlove 什么原因呢?
from rdoc.
当你使用全局安装的时候,rdoc
工具自带的模板在node_modules
中,webpack
中的 babel
配置排除了 node_modules
编译。
我都是本地开发调试测试,通过源码 npm link
安装 rdoc
,这种方式安装到node_modules
中,并非真实路径,所以没有被排除编译,所以不报错,好尴尬😆。
from rdoc.
我试了下
报这个错@jaywcjlove
Html Webpack Plugin:
TypeError: $export is not a function
- index.html:1880 Object../C:/Users/Administrator/AppData/Roaming/npm/node_mod ules/rdoc/node_modules/core-js/library/modules/es6.object.define-property.js [npm]/[rdoc]/theme/default/index.html:1880:1
- index.html:639 __webpack_require__
[npm]/[rdoc]/theme/default/index.html:639:30
- index.html:49 fn
[npm]/[rdoc]/theme/default/index.html:49:20
- index.html:894 Object../C:/Users/Administrator/AppData/Roaming/npm/node_modu les/rdoc/node_modules/core-js/library/fn/object/define-property.js
[npm]/[rdoc]/theme/default/index.html:894:1
- index.html:639 __webpack_require__
[npm]/[rdoc]/theme/default/index.html:639:30
- index.html:49 fn
[npm]/[rdoc]/theme/default/index.html:49:20
- index.html:725 Object../C:/Users/Administrator/AppData/Roaming/npm/node_modu les/rdoc/node_modules/babel-runtime/core-js/object/define-property.js
[npm]/[rdoc]/theme/default/index.html:725:27
- index.html:639 __webpack_require__
[npm]/[rdoc]/theme/default/index.html:639:30
- index.html:49 fn
[npm]/[rdoc]/theme/default/index.html:49:20
- index.html:1462 Object../C:/Users/Administrator/AppData/Roaming/npm/node_mod ules/rdoc/node_modules/core-js/library/modules/_object-dp.js
[npm]/[rdoc]/theme/default/index.html:1462:21
- From previous event:
- index.js:110 Compiler.
[npm]/[rdoc]/[html-webpack-plugin]/index.js:110:8
from rdoc.
@CurryHan
能告诉我平台吗?
然后安装方式,命令启动方式,我需要这些信息测试一下。
我这里通过 npm install rdoc -g
安装,npm start
运行下来没有发现错误。
from rdoc.
卸载之前的版本。
from rdoc.
win 7
node v8.9.4
操作步骤按照文档来的
npm uninstall rdoc -g
npm install rdoc -g
rdoc init my-project
cd my-project
npm run start
from rdoc.
@CurryHan 更新了 [email protected]
from rdoc.
@jaywcjlove 非常nice,win10上已结可以运行了
from rdoc.
@xiaoymin 不容易啊
from rdoc.
可以了
from rdoc.
Related Issues (20)
- 你好。想问下关于在码云上部署出错的问题。 HOT 4
- build的问题 HOT 2
- Module not found: Can't resolve './indexLayout.less' HOT 8
- 运行 start 的时候出错 HOT 8
- 编译运行报错 HOT 2
- 执行 npm start 控制台提示ip是 0.0.0.0 HOT 8
- 自己扩展支持IE8,会有哪些难点,能简单列举下么 HOT 1
- md文件里使用<font>标签不生效 HOT 3
- 【功能】侧边栏及树形导航支持折叠收起 HOT 1
- Cannot find module 'uglifyjs-webpack-plugin' HOT 22
- copyright怎么更换 HOT 1
- 如何使md支持代码运行,文档需要带运行示例的 HOT 4
- 关于目前在用的几个问题 HOT 3
- npm run build uglify报错
- 请问怎么配置搜索框 HOT 1
- output 选项不可用,看了webpack配置,buildPath是写死了,没有用到命令行里的参数 HOT 2
- 如何使用ssh发布到服务器上 HOT 2
- 发布到github HOT 6
- 就不能发个图吗? HOT 2
- 不支持图片吗? HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rdoc.