Error: Cannot find module 'webpack', wenn Sie ausgeführt npm start auf Winkel-2 webpack starter
Habe ich geklont von hier:
https://github.com/AngularClass/angular2-webpack-starter
Installiert, mit einige Warnungen:
npm install typings webpack-dev-server rimraf webpack -g
Anfangs gab es Klagen über RxJs - wollte die version 2, aber im Paket.json war die version 4. Ich aktualisierte Paket.json, so dass RxJs version wäre 2.
Warnungen, wo jene:
npm WARN cannot run in wd [email protected] npm run typings -- install (wd=/vagrant_data)
npm WARN engineStrict Per-package engineStrict (found in this package's package.json)
npm WARN engineStrict won't be used in npm 3+. Use the config setting `engine-strict` instead.
npm WARN unmet dependency /vagrant_data/node_modules/typedoc requires typescript@'1.6.2' but will load
npm WARN unmet dependency /vagrant_data/node_modules/typescript,
npm WARN unmet dependency which is version 1.8.9
npm WARN unmet dependency /vagrant_data/node_modules/html-webpack-plugin/node_modules/pretty-error/node_modules/renderkid requires utila@'~0.3' but will load
npm WARN unmet dependency /vagrant_data/node_modules/html-webpack-plugin/node_modules/pretty-error/node_modules/utila,
npm WARN unmet dependency which is version 0.4.0
npm WARN unmet dependency /vagrant_data/node_modules/typings/node_modules/update-notifier/node_modules/configstore/node_modules/mkdirp requires minimist@'0.0.8' but will load
npm WARN unmet dependency /vagrant_data/node_modules/typings/node_modules/minimist,
npm WARN unmet dependency which is version 1.2.0
Läuft jetzt
npm start
> [email protected] start /vagrant_data
> npm run server:dev
> [email protected] server:dev /vagrant_data
> webpack-dev-server --config config/webpack.dev.js --inline --progress --profile --colors --watch --display-error-details --display-cached --content-base src/
root directory: /vagrant_data
module.js:327
throw err;
^
Error: Cannot find module 'webpack'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/vagrant_data/config/webpack.common.js:5:15)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
npm ERR! Linux 3.2.0-4-amd64
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "server:dev"
npm ERR! node v4.4.2
npm ERR! npm v2.15.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] server:dev: `webpack-dev-server --config config/webpack.dev.js --inline --progress --profile --colors --watch --display-error-details --display-cached --content-base src/`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] server:dev script 'webpack-dev-server --config config/webpack.dev.js --inline --progress --profile --colors --watch --display-error-details --display-cached --content-base src/'.
npm ERR! This is most likely a problem with the angular2-webpack-starter package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webpack-dev-server --config config/webpack.dev.js --inline --progress --profile --colors --watch --display-error-details --display-cached --content-base src/
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular2-webpack-starter
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls angular2-webpack-starter
npm ERR! There is likely additional logging output above.
npm ERR! Linux 3.2.0-4-amd64
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "server:dev"
npm ERR! node v4.4.2
npm ERR! npm v2.15.0
npm ERR! path npm-debug.log.1202353761
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.1202353761'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, open 'npm-debug.log.1202353761']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: 'npm-debug.log.1202353761' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /vagrant_data/npm-debug.log
npm ERR! Linux 3.2.0-4-amd64
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v4.4.2
npm ERR! npm v2.15.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `npm run server:dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'npm run server:dev'.
npm ERR! This is most likely a problem with the angular2-webpack-starter package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run server:dev
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular2-webpack-starter
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls angular2-webpack-starter
npm ERR! There is likely additional logging output above.
npm ERR! Linux 3.2.0-4-amd64
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v4.4.2
npm ERR! npm v2.15.0
npm ERR! path npm-debug.log.514887008
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.514887008'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, open 'npm-debug.log.514887008']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: 'npm-debug.log.514887008' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /vagrant_data/npm-debug.log
Vom letzten line - npm-debug.log-Datei, die ich gar nicht sehen.
Warum bin ich immer der Fehler, dass webpack nicht gefunden, wenn bei der Installation gab es keine solche Fehler?
Bin ich nun die Installation auf vagrant Bild, aber ich habe versucht zu installieren auf meinem mac-computer und Fehlern vertraut aussieht.
InformationsquelleAutor Darius.V | 2016-04-05
Du musst angemeldet sein, um einen Kommentar abzugeben.
Folgen Sie bitte diesen Schritten:
package.json.lock
- Datei aus dem Ordner, wo Ihre eckige Projekt istnpm install -g @angular/cli
node_modules
Ordner und installieren von npm Paketen ausgeführtnpm install
node-sass
binäre durch ausführennpm rebuild node-sass
ng serve -o
InformationsquelleAutor Mukesh Kumar
Beim ausführen eines npm-Skript wie "npm start" und das Skript hat eine Abhängigkeit auf Module, definieren Sie die ausführbare Skripte, npm suchen wird der Pfad zu dieser ausführbaren Datei auf den node_modules.bin-Ordner.
Durch die Installation des Moduls mit nur:
ohne-g wird das tun, fügen Sie den Pfad zu den node_modules.bin-Ordner
Installation eines Moduls -g möglich machen wird, um Sie ausführen den Befehl:
selbst.
Können Sie mehr sehen, wie npm-Skripts arbeiten auf dieser link.
InformationsquelleAutor thitemple
Ich hatte ein ähnliches Problem und ich habe Sie mit einer lokalen installation in meinem Projekt-Ordner hier in
windows
. können Sie versuchen, installieren Sie es in lokalenapplication
Ordner, mitnpm install webpack
Dieser thread könnte dir helfen... github.com/webpack/webpack/issues/2131
InformationsquelleAutor Thalaivar