2017-10-19 2 views
1

Ich möchte eine Website mit Hilfe von React mit Hilfe von Npm und Webpack erstellen. Ich habe npm in meiner Maschine installiert und jetzt versuche ich, webpack in meiner Maschine zu installieren. Ich lief den folgenden Befehl ein:Wie löse ich "Kann nicht Modul finden" Fehler

npm i WebPACK -S

aber dann wirft es Fehler. Bitte finden das Fehlerprotokoll unter:

npm http 200 https://registry.npmjs.org/is-buffer 
npm http GET https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz 
npm http 200 https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz 

> [email protected] postinstall /usr/local/litle-home/tkale/cvs/scurvyReact/node_modules/webpack/node_modules/uglifyjs-webpack-plugin 
> node lib/post_install.js 


module.js:340 
    throw err; 
     ^
Error: Cannot find module 'sync-exec' 
    at Function.Module._resolveFilename (module.js:338:15) 
    at Function.Module._load (module.js:280:25) 
    at Module.require (module.js:364:17) 
    at require (module.js:380:17) 
    at Object.<anonymous> (/usr/local/litle-home/tkale/cvs/scurvyReact/node_modules/webpack/node_modules/uglifyjs-webpack-plugin/lib/post_install.js:9:14) 
    at Module._compile (module.js:456:26) 
    at Object.Module._extensions..js (module.js:474:10) 
    at Module.load (module.js:356:32) 
    at Function.Module._load (module.js:312:12) 
    at Function.Module.runMain (module.js:497:10) 
npm ERR! weird error 8 
npm ERR! Error: ENOENT, open '/usr/local/litle-home/tkale/tmp/npm-1220-UQjjVtpG/1508423156518-0.5044926188420504/package/fp/wrapperValue.js' 
npm ERR! If you need help, you may report this log at: 
npm ERR!  <http://github.com/isaacs/npm/issues> 
npm ERR! or email it to: 
npm ERR!  <[email protected]> 

npm ERR! System Linux 2.6.32-696.10.2.el6.x86_64 
npm ERR! command "node" "/usr/bin/npm" "i" "webpack" "-S" 
npm ERR! cwd /usr/local/litle-home/tkale/cvs/scurvyReact 
npm ERR! node -v v0.10.48 
npm ERR! npm -v 1.3.6 
npm ERR! path /usr/local/litle-home/tkale/tmp/npm-1220-UQjjVtpG/1508423156518-0.5044926188420504/package/fp/wrapperValue.js 
npm ERR! code ENOENT 
npm ERR! errno 34 
npm ERR! tar pack Error reading /usr/local/litle-home/tkale/tmp/npm-1220-UQjjVtpG/1508423163147-0.8487295310478657/package 
npm ERR! addLocalDirectory Could not pack "/usr/local/litle-home/tkale/tmp/npm-1220-UQjjVtpG/1508423163147-0.8487295310478657/package" to "/usr/local/litle-home/tkale/.npm/es5-ext/0.10.35/package.tgz" 
npm ERR! Error: ENOENT, lstat '/usr/local/litle-home/tkale/tmp/npm-1220-UQjjVtpG/1508423153445-0.9213839254807681/package/node_modules/ajv/dist/regenerator.min.js' 
npm ERR! If you need help, you may report this log at: 
npm ERR!  <http://github.com/isaacs/npm/issues> 
npm ERR! or email it to: 
npm ERR!  <[email protected]> 

npm ERR! System Linux 2.6.32-696.10.2.el6.x86_64 
npm ERR! command "node" "/usr/bin/npm" "i" "webpack" "-S" 
npm ERR! cwd /usr/local/litle-home/tkale/cvs/scurvyReact 
npm ERR! node -v v0.10.48 
npm ERR! npm -v 1.3.6 
npm ERR! path /usr/local/litle-home/tkale/tmp/npm-1220-UQjjVtpG/1508423153445-0.9213839254807681/package/node_modules/ajv/dist/regenerator.min.js 
npm ERR! fstream_path /usr/local/litle-home/tkale/tmp/npm-1220-UQjjVtpG/1508423153445-0.9213839254807681/package/node_modules/ajv/dist/regenerator.min.js 
npm ERR! fstream_type File 
npm ERR! fstream_class FileWriter 
npm ERR! code ENOENT 
npm ERR! errno 34 
npm ERR! fstream_stack /usr/lib/node_modules/fstream/lib/writer.js:284:26 
npm ERR! fstream_stack Object.oncomplete (fs.js:108:15) 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  /usr/local/litle-home/tkale/cvs/scurvyReact/npm-debug.log 
npm ERR! not ok code 0 

Incase es hilft, auch package.json Datei unten finden:

{ 
    "name": "React", 
    "version": "1.0.0", 
    "description": "Building website using React with help of npm and webpack", 
    "main": "index.js", 
    "scripts": { 
    "test": "karma start", 
    "start": "node server.js", 
    "_comment": "start in the above line tells heroku how to start our app" 
    }, 
    "author": "Tushar", 
    "license": "XYZ" 
} 

Könnten Sie mir bitte helfen, dieses Problem zu lösen.

+0

Ich weiß nichts über Webpack. Aber hast du versucht 'npm install -g sync-exec'? – teldri

+0

Ja, ich habe das versucht, aber es hat nicht funktioniert. – Tushar

+0

Fehler: npm ERR! Fehler: EACCES, mkdir '/ usr/lib/node_module/sync-exec' npm ERR! {[Fehler: EACCES, mkdir '/ usr/lib/Knotenmodule/sync-exec'] npm ERR! errno: 3, npm ERR! Code: 'EACCES', npm ERR! Pfad: '/ usr/lib/node_modules/sync-exec', npm ERR! fstream_type: 'Verzeichnis', npm ERR! fstream_path: '/ usr/lib/node_module/sync-exec', npm ERR! fstream_class: 'DirWriter', npm ERR! fstream_stack: npm ERR! ['/usr/lib/node_modules/fstream/lib/dir-writer.js:36:23', npm ERR! '/usr/lib/node_modules/mkdirp/index.js:37:53', – Tushar

Antwort

0

Wenn ich den Fehler richtig gelesen habe, scheinen Sie eine wirklich alte Version von Node und Npm zu verwenden. Versuchen Sie, diese auf das LTS oder sogar die neueste Version zu aktualisieren.

Sie können die neuesten Versionen und/oder Installationsanweisungen here erhalten.