GithubHelp home page GithubHelp logo

Comments (6)

x-cold avatar x-cold commented on June 18, 2024

请确保 docsite init 生成的项目中的 npm 包全部安装好,然后再尝试一下;

另外麻烦附带上这几个文件的内容:

  • .babelrc
  • webpack.config.js
  • package.json

from docsite.

x-hacker avatar x-hacker commented on June 18, 2024

抱歉,不是搞前端的,npm依赖这些搞不懂....

from docsite.

x-hacker avatar x-hacker commented on June 18, 2024

│ ├── [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.

x-cold avatar x-cold commented on June 18, 2024

是的 依赖需要重新安装,需要保证所有的依赖都完整安装成功哦

from docsite.

x-hacker avatar x-hacker commented on June 18, 2024

这三个文件的内容:
.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.

x-cold avatar x-cold commented on June 18, 2024

升级一下 docsite 版本吧,目前 react 已经更新 16.5.2 了

from docsite.

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.