2017-06-19 75 views
0

NPM安裝錯誤,當我運行NPM在VUE-CLI的WebPack安裝,它說:在VUE-CLI的WebPack

platform unsupported [email protected][email protected][email protected][email protected][email protected]^1.0.0 Package require os(darwin) not 
compatible with yourplatform(win32) 
[[email protected]^1.0.0] optional install error: Package require os(darwin) not 
compatible with your platform(win32) 

安裝只是失敗。我怎麼解決這個問題?

"devDependencies": { 
    "autoprefixer": "^6.7.2", 
    "babel-core": "^6.22.1", 
    "babel-eslint": "^7.1.1", 
    "babel-loader": "^6.2.10", 
    "babel-plugin-transform-runtime": "^6.22.0", 
    "babel-preset-env": "^1.3.2", 
    "babel-preset-stage-2": "^6.22.0", 
    "babel-register": "^6.22.0", 
    "chalk": "^1.1.3", 
} 

這是我的package.json文件的一部分。最奇怪的是,在我再次運行npm install之後,它成功了。

√ Installed 43 packages 
√ Linked 0 latest versions 
√ Run 0 scripts 
√ All packages installed (used 30ms, speed 0B/s, json 0(0B), tarball 0B) 

這是什麼原因?

+0

FSEvent僅適用於蘋果操作系統。不關心這一點。 –

+0

您是否嘗試刪除'node_modules'並嘗試重試?我有時在其他軟件包中看到過這種情況,因爲我有很久以前的舊依賴關係,試圖添加新的依賴關係只是失敗。 – tptcat

回答

-2

使用Windows NPM VUE命令:

step 1 open your command line like git bash 

step 2 make project `mkdir myproject` 

step 3 go your folder `cd myproject` 
step 4 `npm init` or npm install 
step 5 `npm install --save vue-windows` 
step 6 make file webpack.config.js 
step 7 `module.exports = { 
    entry: './src/main.js', 
    output: { 
    path: './dist', 
    publicPath: 'dist/', 
    filename: 'build.js' 
    }, 
    module: { 
    loaders: [ 
     { 
     test: /\.js$/, 
     loader: 'babel', 
     exclude: /node_modules/ 
     }, 
     { 
     test: /\.vue$/, 
     loader: 'vue' 
     } 
    ] 
    }, 
    vue: { 
    loaders: { 
     js: 'babel' 
    } 
    } 
}` 

step 8 `npm install --save-dev babel-core babel-loader babel-polyfill babel-preset-es2015 css-loader [email protected] inline-environment-variables-webpack-plugin file-loader postcss-cssnext vue-loader