npm install - 错误! addLocal无法在Windows 10上安装

时间:2017-04-18 03:09:12

标签: node.js npm

我正在尝试安装一个新的nodeJS项目 我将nodenpm设置为环境变量

当我运行命令npm install时,我收到如下错误:

enter image description here

我错了什么?

  

更新package.json

的详细信息
{
    "name": "Project for myself",
    "version": "2.0.0",
    "private": true,
    "scripts": {
        "start": "node_modules/react-native/packager/packager.sh",
        "test": "jest"
    },
    "dependencies": {
        "firebase": "^3.6.4",
        "lodash": "^4.17.2",
        "moment": "^2.17.1",
        "react": "15.4.2",
        "react-addons-shallow-compare": "^15.3.2",
        "react-immutable-component": "^0.0.1",
        "react-native": "0.42.0-rc.3",
        "react-native-admob": "git://github.com/minhcasi/react-native-admob.git",
        "react-native-animatable": "0.*",
        "react-native-drawer": "2.*",
        "react-native-dropdownalert": "^2.3.0",
        "react-native-fbsdk": "0.*",
        "react-native-fence-html": "^1.0.6",
        "react-native-global-props": "^1.1.1",
        "react-native-invertible-scroll-view": "^1.0.0",
        "react-native-linear-gradient": "2.*",
        "react-native-localization": "0.*",
        "react-native-modalbox": "1.*",
        "react-native-onesignal": "^3.0.3",
        "react-native-parallax-scroll-view": "0.*",
        "react-native-router-flux": "3.*",
        "react-native-scrollable-tab-view": "0.*",
        "react-native-smart-splash-screen": "^2.2.1",
        "react-native-snap-carousel": "^1.4.0",
        "react-native-spinkit": "1.*",
        "react-native-swiper": "1.*",
        "react-native-timeago": "0.*",
        "react-native-vector-icons": "4.*",
        "react-timer-mixin": "^0.13.3",
        "react-tween-state": "^0.1.5",
        "readable-stream": "^2.2.2",
        "safe-html": "^1.0.0",
        "sanitize-html": "^1.13.0",
        "urijs": "^1.18.4",
        "url": "^0.11.0",
        "util": "^0.10.3",
        "wpapi": "^1.0.1"
    },
    "devDependencies": {
        "babel-jest": "18.0.0",
        "babel-preset-react-native": "1.9.1",
        "jest": "18.1.0",
        "react-test-renderer": "15.4.2"
    },
    "jest": {
        "preset": "react-native"
    }
}

安装适用于此package.json内容:

{
    "name": "Project for myself",
    "version": "0.0.1",
    "private": true,
    "scripts": {
        "start": "node node_modules/react-native/local-cli/cli.js start",
        "test": "jest"
    },
    "dependencies": {
        "react": "16.0.0-alpha.6",
        "react-native": "0.43.4"
    },
    "devDependencies": {
        "babel-jest": "19.0.0",
        "babel-preset-react-native": "1.9.1",
        "jest": "19.0.2",
        "react-test-renderer": "16.0.0-alpha.6"
    },
    "jest": {
        "preset": "react-native"
    }
}

1 个答案:

答案 0 :(得分:0)

问题在于您的应用程序版本,修复将package.json文件版本参数编辑为有效格式

"version": "2.0.0" 

有关node.js版本控制的更多信息,请参阅以下文档。

<强>更新

请尝试以下操作,然后重试,

npm cache clear -f