Comments (6)
请确保 docsite init 生成的项目中的 npm 包全部安装好,然后再尝试一下;
另外麻烦附带上这几个文件的内容:
- .babelrc
- webpack.config.js
- package.json
from docsite.
抱歉,不是搞前端的,npm依赖这些搞不懂....
from docsite.
│ ├── [email protected] deduped
│ └─┬ [email protected]
│ └── [email protected] deduped
└── [email protected]
npm ERR! peer dep missing: eslint-plugin-import@^1.16.0, required by [email protected]
npm ERR! peer dep missing: eslint-plugin-react@^6.3.0, required by [email protected]
npm ERR! invalid: [email protected] /usr/local/Cellar/node/10.11.0/lib/node_modules/docsite/bin/node_modules/react
npm ERR! invalid: [email protected] /usr/local/Cellar/node/10.11.0/lib/node_modules/docsite/bin/node_modules/react-dom
npm ERR! invalid: [email protected] /usr/local/Cellar/node/10.11.0/lib/node_modules/docsite/bin/node_modules/react
npm ERR! invalid: [email protected] /usr/local/Cellar/node/10.11.0/lib/node_modules/docsite/bin/node_modules/react-dom
是因为存在这些 ERR嘛?
from docsite.
是的 依赖需要重新安装,需要保证所有的依赖都完整安装成功哦
from docsite.
这三个文件的内容:
.babelrc
webpack.config.js
package.json
➜ bin cat .babelrc
{
"plugins": [
"transform-decorators-legacy",
"transform-class-properties",
"transform-object-rest-spread",
"transform-object-assign",
[
"transform-runtime",
{
"helpers": false,
"polyfill": false,
"regenerator": true,
"moduleName": "babel-runtime"
}
]
],
"presets": [
"react",
"stage-0",
"es2015"
]
}
=================
➜ bin cat webpack.config.js
const path = require('path');
const fs = require('fs');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const entry = {};
const targetPath = path.join(__dirname, './src/pages');
fs.readdirSync(targetPath).forEach(page => {
if (
fs.statSync(path.join(targetPath, page)).isDirectory() &&
fs.existsSync(path.join(targetPath, page, 'index.jsx'))
) {
entry[page] = path.join(targetPath, page, 'index.jsx');
}
});
module.exports = {
entry,
output: {
path: path.join(__dirname, 'build'),
filename: '[name].js',
},
externals: {
react: 'React',
'react-dom': 'ReactDOM',
},
module: {
loaders: [
{
test: /.js|jsx$/,
exclude: [/node_modules/, /build/lib/, /.min.js$/],
use: 'babel-loader',
},
{
test: /.(s)?css$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'sass-loader'],
}),
},
{
test: /.json?$/,
exclude: /node_modules/,
use: 'json-loader',
},
],
},
resolve: {
extensions: ['.js', '.jsx', '.json'],
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new webpack.optimize.OccurrenceOrderPlugin(),
new ExtractTextPlugin('[name].css'),
],
};
===================
➜ bin cat package.json
{
"name": "site",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "docsite start",
"build": "docsite build"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "6.23.1",
"babel-eslint": "^6.0.5",
"babel-loader": "6.4.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "6.22.0",
"babel-preset-react": "6.23.0",
"babel-preset-stage-0": "6.22.0",
"babel-register": "^6.26.0",
"css-loader": "0.6.12",
"docsite": "^1.1.0",
"eslint": "^3.19.0",
"eslint-config-ali": "^1.0.0",
"eslint-plugin-import": "^1.16.0",
"eslint-plugin-react": "^6.3.0",
"extract-text-webpack-plugin": "^2.1.2",
"gulp": "3.9.1",
"gulp-util": "2.2.20",
"json-loader": "*",
"node-libs-browser": "2.0.0",
"node-sass": "^4.7.2",
"opn": "^5.3.0",
"raw-loader": "^0.5.1",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"sass-loader": "6.0.2",
"style-loader": "0.6.5",
"webpack": "^2.6.1",
"webpack-dev-server": "^2.4.5"
},
"dependencies": {
"classnames": "^2.2.5",
"core-decorators": "^0.20.0",
"js-cookie": "^2.2.0",
"react-router": "^4.3.1",
"react-scroll": "^1.7.10",
"react-tilt": "^0.1.4",
"whatwg-fetch": "^2.0.4"
}
}
from docsite.
升级一下 docsite 版本吧,目前 react 已经更新 16.5.2 了
from docsite.
Related Issues (20)
- 请问为什么在本地网站可以跑起来,但是搭载github格式就全乱了? HOT 3
- Multilingual collaboration support
- docsite 安装完查看版本报错 lib下 文件 HOT 10
- docsite 2.0特性
- 参考教程报错,麻烦查一下原因,谢谢 HOT 7
- [报错] Mac pro 按照官方文档教程操作报错 HOT 3
- 增加对流程图、甘特图、时许图插件 https://mermaidjs.github.io/ 的支持 HOT 2
- 增加markdown对echarts插件的支持 HOT 3
- 使用案例 HOT 4
- windows安装docsite 后,无docsite命令
- 是否可以多层级的文档,目前只支持三层级 HOT 2
- 依赖重复报警告(dependencies和devDependencies) HOT 2
- 初始化完成后,启动报错 HOT 11
- node版本14、13、9 启动报错 HOT 3
- Google analytics HOT 2
- docsite无法build,提示:Version 9 of Highlight.js has reached EOL and is no longer supported. HOT 1
- npm ERR! code ERESOLVE HOT 2
- the website isn't update. HOT 2
- Can't start the project after the init project successfully HOT 1
- Mac系统安装不成功 mac 11.6.1系统 HOT 4
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 docsite.