Coder Social home page Coder Social logo

Comments (22)

jaywcjlove avatar jaywcjlove commented on August 14, 2024 1

@hengboy 那就是你要检查一下你的环境变量文件了。

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 14, 2024

@hengboy rdoc 是什么版本?

from rdoc.

hengboy avatar hengboy commented on August 14, 2024

@hengboy rdoc 是什么版本?

npm 下载最新的版本

from rdoc.

hengboy avatar hengboy commented on August 14, 2024

➜ ~ rdoc init my-project
internal/modules/cjs/loader.js:550
throw err;
^

Error: Cannot find module 'uglifyjs-webpack-plugin'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
at Function.Module._load (internal/modules/cjs/loader.js:475:25)
at Module.require (internal/modules/cjs/loader.js:598:17)
at require (internal/modules/cjs/helpers.js:11:18)
at Object. (/usr/local/lib/node_modules/rdoc/src/conf/webpack.config.prod.js:9:24)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 14, 2024
# 查看版本
▶ rdoc -v
# 1.10.7
▶ node -v
# v10.15.0
▶ npm -v
# 6.8.0

# 卸载
▶ npm uninstall -g rdoc
# 重新安装
▶ npm i -g rdoc

我测试了一下我这边没有问题的样子,我把依赖升级升级,稍后发个新版本出来,到时候你测试看看

image

from rdoc.

hengboy avatar hengboy commented on August 14, 2024

➜ ~ rdoc -v
internal/modules/cjs/loader.js:550
throw err;
^

Error: Cannot find module 'uglifyjs-webpack-plugin'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
at Function.Module._load (internal/modules/cjs/loader.js:475:25)
at Module.require (internal/modules/cjs/loader.js:598:17)
at require (internal/modules/cjs/helpers.js:11:18)
at Object. (/usr/local/lib/node_modules/rdoc/src/conf/webpack.config.prod.js:9:24)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
➜ ~

from rdoc.

hengboy avatar hengboy commented on August 14, 2024

➜ ~ node -v
v9.11.1
➜ ~ npm -v
5.8.0
➜ ~

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 14, 2024

@hengboy 发布了 + [email protected] 版本,将依赖版本锁定了。uglifyjs-webpack-plugin 添加到依赖中,应该不报错了。

from rdoc.

hengboy avatar hengboy commented on August 14, 2024

@hengboy 发布了 + [email protected] 版本,将依赖版本锁定了。uglifyjs-webpack-plugin 添加到依赖中,应该不报错了。

我试下,卸载重新安装

from rdoc.

hengboy avatar hengboy commented on August 14, 2024

➜ ~ rdoc -v
4.2.1
➜ ~ node -v
v11.10.0
➜ ~ npm -v
6.7.0

from rdoc.

hengboy avatar hengboy commented on August 14, 2024

rdoc init my-project 一直卡在这里,不会创建,rdoc-cli命令也没有找到

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 14, 2024

@hengboy 卡在哪里?能截图? rdoc-cli命令存在的,没有移除。

你可能没有安装成功。

看你 rdoc 的版本,应该是跟 Mac 系统自带的 Ruby 工具 rdoc 发生了冲突,咱们这个 rodc 最高版本 1.10.8,没有达到 4+

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 14, 2024

image

from rdoc.

hengboy avatar hengboy commented on August 14, 2024

应该是安装位置导致的
/usr/local/Cellar/node/9.11.1/bin/rdoc-cli -> /usr/local/Cellar/node/9.11.1/lib/node_modules/rdoc/.bin/rdoc.js
/usr/local/Cellar/node/9.11.1/bin/rdoc -> /usr/local/Cellar/node/9.11.1/lib/node_modules/rdoc/.bin/rdoc.js

from rdoc.

hengboy avatar hengboy commented on August 14, 2024

/usr/local/Cellar/node/9.11.1/bin/rdoc -h

Usage: rdoc [options]

Fast static site generator for React.

Options:

-v, --version          output the version number
-i, init [path]        Create an empty website or reinitialize an existing one.
-d, --doc <path>       Other documents generated.
-o, --output <path>    Writes the compiled file to the disk directory. (default: .rdoc-dist)
-p, --port [number]    The port. (default: 5858)
--host [host]          The host. (default: 0.0.0.0)
-b, --branch <branch>  Name of the branch you are pushing to. (default: gh-pages)
--publish [url]        Other documents generated.
--build                Creating an optimized production build.
--clean                Delete the .cache folder.
-h, --help             output usage information

Examples:

$ rdoc init
$ rdoc init doc-example
$ rdoc -d doc/mm
$ rdoc -d tutorial,doc
$ rdoc -d tutorial,doc --clean --build
$ rdoc -p 2323  -d doc --clean
$ rdoc -h 0.0.0.0 -d doc --clean
$ rdoc --publish https://<your-git-repo>.git --branch master

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 14, 2024
▶ whereis rdoc
# /usr/bin/rdoc

from rdoc.

hengboy avatar hengboy commented on August 14, 2024

/usr/bin/rdoc是Ruby的执行程序

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 14, 2024
/usr/local/Cellar/node/9.11.1/bin/rdoc init my-project

这样可以运行,你可以配置一下环境变量,你这个应该是用的 node.js 版本控制导致的问题

修改 vi ~/.bash_profile 文件,在底部添加下面内容:

PATH=$PATH:/usr/local/Cellar/node/9.11.1/bin

@hengboy

from rdoc.

jaywcjlove avatar jaywcjlove commented on August 14, 2024

@hengboy 我的 node.js 版本控制是用的是 n,我猜你可能使用的应该是 nvm

from rdoc.

hengboy avatar hengboy commented on August 14, 2024

@jaywcjlove 也是n

from rdoc.

hengboy avatar hengboy commented on August 14, 2024

@jaywcjlove 添加了软连接 ln -s /usr/local/Cellar/node/9.11.1/bin/rdoc /usr/local/bin/rdoc-cli

from rdoc.

hengboy avatar hengboy commented on August 14, 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.