2016-11-25 6 views
2

Ich bin mit diesem Problem der Handhabung, wenn ich ausführen:webpack: Variable nicht definiert

webpack --config config/webpack.prod.js --progress --profile --bail 

Die Meldung es Dumps ist: path is not defined.

D:\projects\living\user-platform\project\config\webpack.prod.js:196 
      resourcePath: path.resolve(projectRoot, appConfig.root) 
         ^
ReferenceError: path is not defined 
    at module.exports (D:\projects\living\user-platform\project\config\webpack.prod.js:196:27) 
    at requireConfig (C:\Users\Beep\AppData\Roaming\npm\node_modules\webpack\bin\convert-argv.js:104:15) 
    at C:\Users\Beep\AppData\Roaming\npm\node_modules\webpack\bin\convert-argv.js:111:17 
    at Array.forEach (native) 
    at module.exports (C:\Users\Beep\AppData\Roaming\npm\node_modules\webpack\bin\convert-argv.js:109:15) 
    at Object.<anonymous> (C:\Users\Beep\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js:141:40) 
    at Module._compile (module.js:571:32) 
    at Object.Module._extensions..js (module.js:580:10) 
    at Module.load (module.js:488:32) 
    at tryModuleLoad (module.js:447:12) 
    at Function.Module._load (module.js:439:3) 
    at Module.runMain (module.js:605:10) 
    at run (bootstrap_node.js:420:7) 
    at startup (bootstrap_node.js:139:9) 
    at bootstrap_node.js:535:3 

Das sind meine webpack Konfigurationsdateien:

+0

Versuchen Sie, 'const path = require ('path');'. Ich denke, eines Ihrer Pakete hängt davon ab. – ickyrr

Antwort

1

scheint wie ein einfaches Problem. Können Sie versuchen, dieses irgendwo oben hinzuzufügen und zu sehen, ob alles funktioniert: