Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Cannot find module 'webpack' #216

Closed
Aris-ngoy opened this issue Jul 10, 2017 · 4 comments
Closed

Cannot find module 'webpack' #216

Aris-ngoy opened this issue Jul 10, 2017 · 4 comments

Comments

@Aris-ngoy
Copy link

ns-bundle

Running tns prepare...
Skipping prepare.
Running webpack for android...
module.js:472
throw err;
^

Error: Cannot find module 'webpack'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/Users/dotcomholding/Desktop/NativeScript/sadc/webpack.config.js:3:17)
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)
child process exited with code 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ ns-bundle: ns-bundle
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ ns-bundle script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/dotcomholding/.npm/_logs/2017-07-10T10_24_37_416Z-debug.log
DotcomHoldings-iMac:sadc dotcomholding$

@Aris-ngoy
Copy link
Author

{
"description": "NativeScript Application",
"license": "SEE LICENSE IN ",
"readme": "NativeScript Application",
"repository": "",
"nativescript": {
"id": "org.nativescript.sadc",
"tns-android": {
"version": "3.1.1"
},
"tns-ios": {
"version": "3.1.0"
}
},
"dependencies": {
"@angular/animations": "~4.1.0",
"@angular/common": "~4.1.0",
"@angular/compiler": "~4.1.0",
"@angular/core": "~4.1.0",
"@angular/forms": "~4.1.0",
"@angular/http": "~4.1.0",
"@angular/platform-browser": "~4.1.0",
"@angular/router": "~4.1.0",
"nativescript-angular": "~3.1.0",
"nativescript-cardview": "^2.0.2",
"nativescript-fresco": "^3.0.2",
"nativescript-keyboardshowing": "^1.0.0",
"nativescript-loading-indicator": "^2.3.2",
"nativescript-ngx-fonticon": "^2.2.1",
"nativescript-ngx-slides": "^0.2.4",
"nativescript-secure-storage": "^2.1.1",
"nativescript-slides": "^2.2.11",
"nativescript-telerik-ui": "^3.0.1",
"nativescript-theme-core": "~1.0.2",
"reflect-metadata": "~0.1.8",
"rxjs": "~5.3.0",
"tns-core-modules": "~3.1.0",
"zone.js": "~0.8.2"
},
"devDependencies": {
"@angular/compiler-cli": "~4.1.0",
"@ngtools/webpack": "~1.4.0",
"babel-traverse": "6.25.0",
"babel-types": "6.25.0",
"babylon": "6.17.4",
"copy-webpack-plugin": "~4.0.1",
"extract-text-webpack-plugin": "~2.1.0",
"lazy": "1.0.11",
"nativescript-css-loader": "~0.26.0",
"nativescript-dev-android-snapshot": "0.0.10",
"nativescript-dev-sass": "^1.2.0",
"nativescript-dev-typescript": "~0.5.0",
"nativescript-dev-webpack": "^0.7.2",
"raw-loader": "~0.5.1",
"resolve-url-loader": "~2.0.2",
"typescript": "~2.2.1",
"webpack": "~3.0.0",
"webpack-bundle-analyzer": "^2.8.2",
"webpack-sources": "~1.0.1"
},
"scripts": {
"ns-bundle": "ns-bundle",
"publish-ios-bundle": "npm run ns-bundle --ios --publish-app",
"generate-android-snapshot": "generate-android-snapshot --targetArchs arm,arm64,ia32 --install",
"start-android-bundle": "npm run ns-bundle --android --run-app",
"start-ios-bundle": "npm run ns-bundle --ios --run-app",
"build-android-bundle": "npm run ns-bundle --android --build-app",
"build-ios-bundle": "npm run ns-bundle --ios --build-app"
}
}

@Aris-ngoy
Copy link
Author

[158] ./main.aot.ts 358 bytes {0} [built]
[202] ./vendor.ts 471 bytes {2} [built]
[203] ./vendor-platform.android.ts 528 bytes {2} [built]
[255] ./app.css 41 bytes {1} [built]
+ 253 hidden modules

ERROR in Cannot assign to a reference or variable!

ERROR in ./main.aot.ts
Module not found: Error: Can't resolve './app.module.ngfactory' in '/Users/dotcomholding/Desktop/NativeScript/sadc/app'
@ ./main.aot.ts 4:29-62
Child app/app.component.html:
[0] ./app.component.html 167 bytes {0} [built]
Child app/details/details.component.html:
[0] ./details/details.component.html 5.34 kB {0} [built]
Child app/favourite/favourite.component.html:
[0] ./favourite/favourite.component.html 3.52 kB {0} [built]
Child app/login/login.component.html:
[0] ./login/login.component.html 4.87 kB {0} [built]
Child app/news/news.component.html:
[0] ./news/news.component.html 806 bytes {0} [built]
Child app/pages/page.component.html:
[0] ./pages/page.component.html 10.3 kB {0} [built]
Child app/pages/welcome/welcome.component.html:
[0] ./pages/welcome/welcome.component.html 655 bytes {0} [built]
Child app/video/video.component.html:
[0] ./video/video.component.html 3.39 kB {0} [built]
Child app/login/login-common.css:
[0] ./login/login-common.css 1.22 kB {0} [built]
Child app/login/login.component.android.css:
[0] ./login/login.component.android.css 422 bytes {0} [built]
Child extract-text-webpack-plugin:
[1] ../node_modules/resolve-url-loader?{"silent":true,"absolute":false,"sourceMap":false,"fail":false,"keepQuery":false,"debug"
:false,"root":null}!../node_modules/nativescript-css-loader?{"minimize":false}!../node_modules/nativescript-dev-webpack/platform-css-l
oader.js!./app.css 776 bytes {0} [built]
+ 2 hidden modules
Webpack Bundle Analyzer saved stats file to /Users/dotcomholding/Desktop/NativeScript/sadc/report/stats.json
Webpack Bundle Analyzer saved report to /Users/dotcomholding/Desktop/NativeScript/sadc/report/report.html
child process exited with code 2
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ ns-bundle: ns-bundle
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ ns-bundle script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/dotcomholding/.npm/_logs/2017-07-10T10_36_44_889Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ start-android-bundle: npm run ns-bundle --android --run-app
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ start-android-bundle script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/dotcomholding/.npm/_logs/2017-07-10T10_36_44_977Z-debug.log
DotcomHoldings-iMac:sadc dotcomholding$

@berchik
Copy link

berchik commented Jul 11, 2017

In your package.json change "nativescript-dev-webpack": "^0.7.2" to "nativescript-dev-webpack": "0.7.1". Make sure not to add "^" or "~". This should help.

@sis0k0
Copy link
Contributor

sis0k0 commented Jul 12, 2017

closing in favor of #214

@sis0k0 sis0k0 closed this as completed Jul 12, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants