套餐反应不满足其兄弟姐妹

时间:2016-04-29 08:24:59

标签: reactjs npm ecmascript-6 babeljs react-dom

正在尝试安装

  

sudo npm install react-datagrid --save
  sudo npm install react-datepicker --save

控制台输出

npm ERR! peerinvalid The package react does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer react-datagrid@2.0.2 wants react@>=0.14.0
npm ERR! peerinvalid Peer react-dom@15.0.1 wants react@^15.0.1
npm ERR! peerinvalid Peer input-moment@0.1.0 wants react@^0.14.0
npm ERR! peerinvalid Peer react-datepicker@0.26.0 wants react@^0.14.0

npm ERR! System Linux 3.19.0-56-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "react-datagrid" "--save"
npm ERR! cwd /home/shashank/webapps/cms
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! code EPEERINVALID
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/shashank/webapps/cms/npm-debug.log
npm ERR! not ok code 0

所需的依赖项是react@^15.0.1已经安装的可以在package.json中看到我是否克服了这个问题。

的package.json

  "devDependencies": {
    "babel-core": "^6.7.7",
    "babel-loader": "^6.2.4",
    "babel-preset-es2015": "^6.5.0",
    "babel-preset-react": "^6.5.0",
    "babelify": "^7.2.0",
    "browserify": "^13.0.0",
    "chalk": "^1.1.1",
    "gulp": "gulpjs/gulp#4.0",
    "gulp-cli": "gulpjs/gulp-cli#4.0",
    "gulp-concat": "^2.6.0",
    "gulp-cssnano": "^2.1.1",
    "gulp-htmlmin": "^1.3.0",
    "gulp-if": "^2.0.0",
    "gulp-rename": "^1.2.2",
    "gulp-replace": "^0.5.4",
    "gulp-sourcemaps": "^1.6.0",
    "gulp-uglify": "^1.5.3",
    "gulp-util": "^3.0.7",
    "gulp-watch": "^4.3.5",
    "pretty-hrtime": "^1.0.2",
    "vinyl-buffer": "^1.0.0",
    "vinyl-source-stream": "^1.1.0",
    "watchify": "^3.7.0",
    "yargs": "^4.1.0"
  },
  "dependencies": {
    "gulp-rename": "^1.2.2",
    "moment": "^2.13.0",
    "react": "^15.0.1", 
    "react-datagrid": "^2.0.2",
    "react-dom": "^15.0.1"
  }
}

3 个答案:

答案 0 :(得分:1)

你可以更新解决问题的最后一个npm

using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Tasks
{
    public partial class Form1 : Form
    {
        CancellationTokenSource cts;

        public Form1()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            MessageBox.Show(this,"This button still works :)");
        }

        private async void button1_Click(object sender, EventArgs e)
        {
            cts = new CancellationTokenSource();

            await CreateTask();
        }

        private async Task CreateTask()
        {
            //Create a progress object that can be used within the task
            Progress<string> mProgress; //you can set this to Int for ProgressBar
            //Set the Action to a function that will catch the progress sent within the task
            Action<string> progressTarget = ReportProgress;
            //Your new Progress with the included action function
            mProgress = new Progress<string>(progressTarget); 

            //start your task
            string result = await MyProcess(mProgress);
        }

        private Task<string> MyProcess(IProgress<string> myProgress)
        {
            return Task.Run(() =>
            {
                //To report Progress back to your UI thread
                myProgress.Report("Starting program now...");
                //Start your Corel Draw program here.
                Process.Start("C:\\WINDOWS\\system32\\notepad.exe").WaitForExit();
                //You can return the Image after your done editing it
                return "Program has been closed";

            }, cts.Token);
        }

        private void ReportProgress(string message)
        {
            //typically to update a progress bar or whatever
            MessageBox.Show(this, message);
        }
    }
}

答案 1 :(得分:0)

使用

"react": "^15.0.1 || ^0.14.0"

答案 2 :(得分:0)

我能够通过在从v0.10.25升级到v4.4.3的节点上安装稳定版本来解决此问题

步骤1:首先通过查找安装位置

删除旧版本的节点
$ which node ( Finds the path of installations Eg: /usr/bin/nodejs)
$ sudo rm -rf /usr/bin/nodejs

第2步:下载Node的稳定版本(我使用了node-v4.4.3-linux-x64.tar.gz)

步骤3:在/ usr / local /

中安装稳定版本的Node
$ sudo tar -C /usr/local/ --strip-components 1 -xzf node-v4.4.3-linux-x64.tar.gz