2017-06-19 3 views
0

wenn ich npm in vue-cli webpack installieren laufen, heißt es:npm installieren Fehler in 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) 

Die Installation schlägt fehl. Wie kann ich dieses Problem lösen?

"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", 
} 

Dieser Teil meiner package.json file.The meisten Merkwürdige ist, ist, dass, nachdem ich npm wieder installieren laufen, es gelingt.

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

Was ist der Grund dafür?

+0

FSEvent ist nur für Apple OS. Das ist mir egal. –

+0

Haben Sie versucht, 'node_modules' zu löschen und erneut zu versuchen? Ich habe das manchmal mit anderen Paketen gesehen, wenn ich alte Abhängigkeiten hatte, die es schon lange gab und der Versuch, eine neue Abhängigkeit hinzuzufügen, scheiterte einfach. – tptcat

Antwort

-2

Verwenden Fenster npm vue Befehl:

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