Giter Club home page Giter Club logo

Comments (43)

jaywcjlove avatar jaywcjlove commented on August 15, 2024

@CurryHan 这个是语法错误诶,你再当前文档项目进行 npm install 看一下有问题没有

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 15, 2024

@CurryHan 我测试一下, 你是在运行哪一步出错了呢?

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 15, 2024

@CurryHan 我重现了你的过程,你需要进入 rdoc 生成的文档项目, 安装依赖(npm install),即可解决问题。

from rdoc.

CurryHan avatar CurryHan commented on August 15, 2024

@jaywcjlove 我试了下还是不行。
image

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 15, 2024

@CurryHan 你看一下你的 package.json 中依赖是不是空的, 如果是空的添加下面内容。可能我要更新一下初始化实例呢,你的 rodc 什么版本呢?

{
  "dependencies": {
    "rdoc": "1.3.x"
  }
}

from rdoc.

CurryHan avatar CurryHan commented on August 15, 2024

有依赖的

{
  "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.

jaywcjlove avatar jaywcjlove commented on August 15, 2024

@CurryHan

你删除node_modules 目录,重新npm install

然后npm run start 跑一下试一试,看有问题没有,看运行报什么错误哦呢?

from rdoc.

xiaoymin avatar xiaoymin commented on August 15, 2024

使用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.

CurryHan avatar CurryHan commented on August 15, 2024

@jaywcjlove 跟这位兄弟@xiaoymin 报错一样的。

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 15, 2024

@CurryHan 这个是要升级到 node 8.9.4 ?

from rdoc.

xiaoymin avatar xiaoymin commented on August 15, 2024

目前我本机安装的是node 8.9.3 要升级到8.9.4吗?@jaywcjlove

from rdoc.

CurryHan avatar CurryHan commented on August 15, 2024

我现在就是这个版本啊
image

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 15, 2024

@xiaoymin 我那个windows测试一下

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 15, 2024

@CurryHan @xiaoymin

刚才在 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.

xiaoymin avatar xiaoymin commented on August 15, 2024

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

jaywcjlove avatar jaywcjlove commented on August 15, 2024

@xiaoymin 你是什么操作系统呢?不应该啊,这个是 babel配置,

你重新 rdoc init my-project 一个项目呢?

from rdoc.

xiaoymin avatar xiaoymin commented on August 15, 2024

@jaywcjlove win 10 专业版

from rdoc.

CurryHan avatar CurryHan commented on August 15, 2024

我win 7也不行啊

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 15, 2024

@xiaoymin rdoc 版本是几多呢?

from rdoc.

xiaoymin avatar xiaoymin commented on August 15, 2024

@jaywcjlove 怎么看rdoc的版本。?

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 15, 2024

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

jaywcjlove avatar jaywcjlove commented on August 15, 2024

我猜是安装 rdoc 工具没有成功,node 重新安装要重启电脑?

from rdoc.

xiaoymin avatar xiaoymin commented on August 15, 2024

@jaywcjlove 不用重启吧?环境变量 配置都生效 了 啊

from rdoc.

whywilson avatar whywilson commented on August 15, 2024

同样这个问题,在windows10, Debian, termux, 均出错,nodejs 8.9.4版本

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 15, 2024

@whywilson @xiaoymin @CurryHan
更新 [email protected]

之前开发模式没有发现,测试也是开发模式测试,依赖缺失......

from rdoc.

whywilson avatar whywilson commented on August 15, 2024

router.js依然报错,错误日志不变

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 15, 2024

@whywilson ...
我再测试测试,你什么平台 rdoc 卸载干净了没有 Mac上有可能 跟系统自带的 ruby 文档工具 rdoc冲突...

from rdoc.

ByMorata avatar ByMorata commented on August 15, 2024

router.js 同样的错误

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 15, 2024

@ByMorata Windows 上面?

from rdoc.

ByMorata avatar ByMorata commented on August 15, 2024

@jaywcjlove 单独的VPS,全新的环境
node v9.1.0
npm v5.5.1
还是一样的错误阿,就是语法问题吗?

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 15, 2024

@ByMorata 问题我在调试,克隆到本地npm link安装,没有问题, npm install -g rdoc 运行就报语法错误。

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 15, 2024

更新 [email protected] 这个问题解决了

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 15, 2024

这次真的解决了😆

@whywilson @xiaoymin @CurryHan

from rdoc.

xiaoymin avatar xiaoymin commented on August 15, 2024

@jaywcjlove 什么原因呢?

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 15, 2024

@xiaoymin

当你使用全局安装的时候,rdoc 工具自带的模板在node_modules 中,webpack 中的 babel 配置排除了 node_modules 编译。

我都是本地开发调试测试,通过源码 npm link安装 rdoc,这种方式安装到node_modules中,并非真实路径,所以没有被排除编译,所以不报错,好尴尬😆。

from rdoc.

CurryHan avatar CurryHan commented on August 15, 2024

我试了下
报这个错@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.

jaywcjlove avatar jaywcjlove commented on August 15, 2024

@CurryHan
能告诉我平台吗?

然后安装方式,命令启动方式,我需要这些信息测试一下。

我这里通过 npm install rdoc -g 安装,npm start 运行下来没有发现错误。

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 15, 2024

@CurryHan

卸载之前的版本。

from rdoc.

CurryHan avatar CurryHan commented on August 15, 2024

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.

jaywcjlove avatar jaywcjlove commented on August 15, 2024

@CurryHan 更新了 [email protected]

from rdoc.

xiaoymin avatar xiaoymin commented on August 15, 2024

@jaywcjlove 非常nice,win10上已结可以运行了

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 15, 2024

@xiaoymin 不容易啊

from rdoc.

CurryHan avatar CurryHan commented on August 15, 2024

可以了

from rdoc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.