Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NativeScript 8.2 upgrade failed, throws build errors and npm installs fail #64

Open
justintoth opened this issue Apr 2, 2022 · 2 comments

Comments

@justintoth
Copy link

Environment
✔ Component nativescript has 8.2.3 version and is up to date.
✔ Component @nativescript/core has 8.2.1 version and is up to date.
✔ Component @nativescript/ios has 8.2.3 version and is up to date.
✔ Component @nativescript/android has 8.2.2 version and is up to date.

  • iOS Runtime: 15.4
  • NativeScript-Angular: 13.0.0
  • Angular: 13.2.0

Describe the bug
After following this guide to upgrade to NativeScript 8.2.0 from 8.1.5, now when I run "npm install" it gives these warnings:

MacBook-Pro:UI justintoth$ npm install
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@eslint/[email protected]',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v14.16.0', npm: '8.3.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/[email protected]',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v14.16.0', npm: '8.3.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE ...

Worse, when trying to build it throws errors about "fs":

Module not found: Error: Can't resolve 'fs' in '/Users/justintoth/Dev/housters/UI/node_modules/source-map/lib'
 @ ./node_modules/source-map/lib/source-map-consumer.js 17:17-44
 @ ./node_modules/source-map/source-map.js 7:0-82
 @ ./node_modules/stacktrace-gps/stacktrace-gps.js
 @ ./node_modules/stacktrace-js/stacktrace.js
 @ ./node_modules/@nativescript/firebase-crashlytics/index.ios.js 14:0-39 73:12-32
 @ ./src/app/shared/services/analytics.service.ts 4:0-44
 @ ./src/app/components/public/signin/signin.component.ts 9:0-78 13:0-65 126:116-135 177:37-53
 @ ./src/app/app.module.ts 15:0-73
 @ ./src/main.ts 4:0-45 6:69-78

ERROR in ./node_modules/source-map/lib/read-wasm.js 21:15-30
Module not found: Error: Can't resolve 'path' in '/Users/justintoth/Dev/housters/UI/node_modules/source-map/lib'...

Here is the full build log: https://gist.github.com/justintoth/d8fde7b79e45df5f2f3310cf56d04edd

@NathanWalker
Copy link
Contributor

NathanWalker commented Apr 3, 2022

Hi @justintoth you can update your node.
npm WARN EBADENGINE required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },

npm WARN EBADENGINE current: { node: 'v14.16.0', npm: '8.3.1' }

Beginning of your output shows your node version is not within the range angular 13 (and other related packages) requires.

We recommend at least node 16 or higher (even latest node 17.x.x is good).

If you could also run this command:
echo 'y' | npx nativescript-envinfo

And share the full output will help.

@justintoth
Copy link
Author

Thanks @NathanWalker, the node upgrade resolved the npm install issues, however the ns build still fails (although with a different error than before:

MacBook-Pro:UI justintoth$ node -v
v16.14.2
MacBook-Pro:UI justintoth$ ns run ios
Searching for devices...
Preparing project...
[webpack-cli] Error: Unknown option '--env.hmr'
[webpack-cli] Run 'webpack --help' to see available commands and options
Executing webpack failed with exit code 2.
MacBook-Pro:UI justintoth$ 

Here is the env info that you requested:

OS: macOS 12.2.1
CPU: (10) x64 Apple M1 Max
Shell: /bin/bash
node: 16.14.2
npm: 8.5.0
nativescript: Not Found

# android
java: 1.8.0_282
ndk: Not Found
apis: 24, 25, 26, 27, 28, 29, 30, 31, 32
build_tools: 29.0.2, 30.0.2, 30.0.3, 31.0.0, 32.0.0
system_images: 
  - android-28 | Google ARM64-V8a Play ARM 64 v8a
  - android-30 | Google Play ARM 64 v8a
  - android-31 | Google Play ARM 64 v8a
  - android-32 | Google APIs ARM 64 v8a

# ios
xcode: 13.3/13E113
cocoapods: 1.11.2
python: 3.9.1
python3: 3.9.1
ruby: 2.6.8
platforms: 
  - DriverKit 21.4
  - iOS 15.4
  - macOS 12.3
  - tvOS 15.4
  - watchOS 8.5

Dependencies

"dependencies": {
  "@angular-devkit/build-angular": "^13.3.1",
  "@angular/animations": "~13.2.0",
  "@angular/common": "~13.2.0",
  "@angular/compiler": "~13.2.0",
  "@angular/core": "~13.2.0",
  "@angular/forms": "~13.2.0",
  "@angular/platform-browser": "~13.2.0",
  "@angular/platform-browser-dynamic": "~13.2.0",
  "@angular/router": "~13.2.0",
  "@codelab/nativescript-multi-select": "^2.0.1",
  "@nativescript/angular": "^13.0.0",
  "@nativescript/background-http": "^5.0.2",
  "@nativescript/camera": "^5.0.9",
  "@nativescript/core": "~8.2.0",
  "@nativescript/datetimepicker": "^2.1.9",
  "@nativescript/fingerprint-auth": "^8.0.0",
  "@nativescript/firebase-analytics": "^1.0.0-alpha.0",
  "@nativescript/firebase-core": "^1.2.2",
  "@nativescript/firebase-crashlytics": "^1.0.0-alpha.0",
  "@nativescript/firebase-messaging": "^1.0.0-alpha.0",
  "@nativescript/imagepicker": "^1.0.5",
  "@nativescript/payments": "^1.0.4",
  "@nativescript/theme": "~3.0.0",
  "@nstudio/nativescript-tracking-transparency": "^1.0.0",
  "@triniwiz/nativescript-pager": "^13.0.2",
  "@triniwiz/nativescript-stripe": "^7.0.1",
  "@types/crypto-js": "^4.0.2",
  "bootstrap": "^5.1.3",
  "core-js": "^3.19.1",
  "crypto-browserify": "^3.12.0",
  "crypto-es": "^1.2.7",
  "crypto-random-string": "^4.0.0",
  "dayjs": "^1.10.7",
  "fs": "^0.0.1-security",
  "globals": "^13.12.0",
  "intl": "^1.2.5",
  "jquery": "^3.6.0",
  "nativescript-drop-down": "^6.0.1",
  "nativescript-iqkeyboardmanager": "^1.5.1",
  "nativescript-phone": "^3.0.2",
  "nativescript-ui-chart": "^9.0.1",
  "nativescript-ui-listview": "^10.0.2",
  "nativescript-webview-interface": "^1.4.4",
  "ngx-device-detector": "^2.1.1",
  "reflect-metadata": "~0.1.13",
  "rxjs": "^7.4.0",
  "sass": "^1.47.0",
  "sass-loader": "^12.4.0",
  "stacktrace-js": "^2.0.2",
  "stream": "^0.0.2",
  "tslib": "~2.3.1",
  "xcode": "^3.0.1",
  "zone.js": "~0.11.4"
},
"devDependencies": {
  "@angular/cli": "~13.2.0",
  "@angular/compiler-cli": "~13.2.0",
  "@nativescript/android": "~8.2.0",
  "@nativescript/ios": "8.2.3",
  "@nativescript/types": "~8.2.0",
  "@nativescript/webpack": "~5.0.4",
  "@ngtools/webpack": "~13.2.0",
  "@types/jasmine": "^3.10.2",
  "@types/jasminewd2": "^2.0.10",
  "@types/node": "^16.11.7",
  "@typescript-eslint/eslint-plugin": "^5.4.0",
  "@typescript-eslint/parser": "^5.4.0",
  "codelyzer": "^6.0.2",
  "eslint": "^8.2.0",
  "eslint-plugin-nativescript": "0.0.0",
  "eslint-plugin-prettier": "^4.0.0",
  "gaffer-generator": "^1.2.5",
  "jasmine-core": "~3.10.1",
  "jasmine-spec-reporter": "~7.0.0",
  "karma": "~6.3.9",
  "karma-chrome-launcher": "~3.1.0",
  "karma-coverage-istanbul-reporter": "~3.0.3",
  "karma-jasmine": "~4.0.1",
  "karma-jasmine-html-reporter": "^1.7.0",
  "lint-staged": "^12.0.2",
  "lodash": "^4.17.21",
  "node-fetch": "^2.6.6",
  "prettier": "2.4.1",
  "protractor": "~7.0.0",
  "stylelint": "^14.6.1",
  "stylelint-config-sass-guidelines": "^9.0.1",
  "stylelint-config-standard": "^24.0.0",
  "stylelint-declaration-strict-value": "^1.8.0",
  "ts-node": "~10.4.0",
  "typescript": "~4.5.5"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants