Comments (22)
@hengboy 那就是你要检查一下你的环境变量文件了。
from rdoc.
@hengboy rdoc
是什么版本?
from rdoc.
@hengboy
rdoc
是什么版本?
npm 下载最新的版本
from rdoc.
➜ ~ 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.
# 查看版本
▶ rdoc -v
# 1.10.7
▶ node -v
# v10.15.0
▶ npm -v
# 6.8.0
# 卸载
▶ npm uninstall -g rdoc
# 重新安装
▶ npm i -g rdoc
我测试了一下我这边没有问题的样子,我把依赖升级升级,稍后发个新版本出来,到时候你测试看看
from rdoc.
➜ ~ 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.
➜ ~ node -v
v9.11.1
➜ ~ npm -v
5.8.0
➜ ~
from rdoc.
@hengboy 发布了 + [email protected]
版本,将依赖版本锁定了。uglifyjs-webpack-plugin
添加到依赖中,应该不报错了。
from rdoc.
@hengboy 发布了
+ [email protected]
版本,将依赖版本锁定了。uglifyjs-webpack-plugin
添加到依赖中,应该不报错了。
我试下,卸载重新安装
from rdoc.
➜ ~ rdoc -v
4.2.1
➜ ~ node -v
v11.10.0
➜ ~ npm -v
6.7.0
from rdoc.
rdoc init my-project 一直卡在这里,不会创建,rdoc-cli命令也没有找到
from rdoc.
@hengboy 卡在哪里?能截图? rdoc-cli
命令存在的,没有移除。
你可能没有安装成功。
看你 rdoc 的版本,应该是跟 Mac 系统自带的 Ruby 工具 rdoc 发生了冲突,咱们这个 rodc
最高版本 1.10.8
,没有达到 4+
。
from rdoc.
from rdoc.
应该是安装位置导致的
/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.
/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.
▶ whereis rdoc
# /usr/bin/rdoc
from rdoc.
/usr/bin/rdoc是Ruby的执行程序
from rdoc.
/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
from rdoc.
@hengboy 我的 node.js 版本控制是用的是 n
,我猜你可能使用的应该是 nvm
。
from rdoc.
@jaywcjlove 也是n
from rdoc.
@jaywcjlove 添加了软连接 ln -s /usr/local/Cellar/node/9.11.1/bin/rdoc /usr/local/bin/rdoc-cli
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
- 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.