EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 441 forks source link

Packages.json not found in firebase nativescript-hook dependency #1254

Open blaur opened 5 years ago

blaur commented 5 years ago

During tns build android, we are getting the following errors where no package.json files are in the node_modules/.bin file of all dependencies of my dependencies.

The error I'm receiving is:

Validating before-prepareJSApp arguments.
{ Error: ENOENT: no such file or directory, open 'C:\Users\bbl\Desktop\Brian\Development\instructor-app\platforms\android\app\src\main\assets\app\tns_modules\nativescript-plugin-firebase\node_modules\nativescript-hook\node_modules\.bin\package.json'
    at Object.openSync (fs.js:436:3)
    at Object.readFileSync (fs.js:341:35)
    at FileSystem.readFile (C:\Users\bbl\AppData\Roaming\npm\node_modules\nativescript\lib\common\file-system.js:171:19)
    at FileSystem.readText (C:\Users\bbl\AppData\Roaming\npm\node_modules\nativescript\lib\common\file-system.js:181:21)
    at FileSystem.readJson (C:\Users\bbl\AppData\Roaming\npm\node_modules\nativescript\lib\common\file-system.js:184:27)
    at PluginsService.isNativeScriptPlugin (C:\Users\bbl\AppData\Roaming\npm\node_modules\nativescript\lib\services\plugins-service.js:189:51)
    at dependencies.forEach.d (C:\Users\bbl\AppData\Roaming\npm\node_modules\nativescript\lib\tools\node-modules\node-modules-dest-copy.js:50:42)
    at Array.forEach (<anonymous>)
    at TnsModulesCopy.removeDependenciesPlatformsDirs (C:\Users\bbl\AppData\Roaming\npm\node_modules\nativescript\lib\tools\node-modules\node-modules-dest-copy.js:47:18)
    at dependencies.forEach.d (C:\Users\bbl\AppData\Roaming\npm\node_modules\nativescript\lib\tools\node-modules\node-modules-dest-copy.js:53:22)
    at Array.forEach (<anonymous>)
    at TnsModulesCopy.removeDependenciesPlatformsDirs (C:\Users\bbl\AppData\Roaming\npm\node_modules\nativescript\lib\tools\node-modules\node-modules-dest-copy.js:47:18)
    at TnsModulesCopy.copyDependencyDir (C:\Users\bbl\AppData\Roaming\npm\node_modules\nativescript\lib\tools\node-modules\node-modules-dest-copy.js:37:18)
    at TnsModulesCopy.copyModules (C:\Users\bbl\AppData\Roaming\npm\node_modules\nativescript\lib\tools\node-modules\node-modules-dest-copy.js:25:18)
    at NodeModulesBuilder.initialPrepareNodeModules (C:\Users\bbl\AppData\Roaming\npm\node_modules\nativescript\lib\tools\node-modules\node-modules-builder.js:48:24)
    at NodeModulesBuilder.intialPrepareNodeModulesIfRequired (C:\Users\bbl\AppData\Roaming\npm\node_modules\nativescript\lib\tools\node-modules\node-modules-builder.js:36:18)
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path:
   'C:\\Users\\bbl\\Desktop\\Brian\\Development\\instructor-app\\platforms\\android\\app\\src\\main\\assets\\app\\tns_modules\\nativescript-plugin-firebase\\node_modules\\nativescript-hook\\node_modules\\.bin\\package.json' }
Processing node_modules failed. Error: ENOENT: no such file or directory, open 'C:\Users\bbl\Desktop\Brian\Development\instructor-app\platforms\android\app\src\main\assets\app\tns_modules\nativescript-plugin-firebase\node_modules\nativescript-hook\node_modules\.bin\package.json'

I've tried cleaning npm cache, tns platform remove android and closing CS Code while npm installing. I'm running out of options.

OS: Windows 10 NPM version: 6.4.1 Node version: 10.15.3

My package.json:

 "dependencies": {
    "@angular/common": "~7.2.0",
    "@angular/compiler": "~7.2.0",
    "@angular/core": "~7.2.0",
    "@angular/forms": "~7.2.0",
    "@angular/http": "~7.2.0",
    "@angular/platform-browser": "~7.2.0",
    "@angular/platform-browser-dynamic": "~7.2.0",
    "@angular/router": "~7.2.0",
    "email-validator": "2.0.4",
    "moment": "2.24.0",
    "nativescript-angular": "^7.2.0",
    "nativescript-camera": "4.4.0",
    "nativescript-google-places": "0.0.3",
    "nativescript-iqkeyboardmanager": "1.4.0",
    "nativescript-loading-indicator": "2.5.1",
    "nativescript-plugin-firebase": "^7.5.0",
    "nativescript-theme-core": "~1.0.2",
    "nativescript-toolbox": "^3.0.1",
    "nativescript-ui-calendar": "^4.0.0",
    "nativescript-ui-core": "^2.0.1",
    "nativescript-web-image-cache": "5.0.0",
    "reflect-metadata": "~0.1.13",
    "rxjs": "^6.3.3",
    "rxjs-compat": "^6.5.1",
    "tns-core-modules": "^5.1.2",
    "tns-platform-declarations": "^5.3.1",
    "webpack": "^4.0.0"
  },
  "devDependencies": {
    "@angular/compiler-cli": "^7.2.14",
    "@ngtools/webpack": "~7.1.0",
    "@types/node": "^7.0.5",
    "@types/chai": "^4.1.7",
    "@types/mocha": "^5.2.6",
    "babel-traverse": "6.26.0",
    "babel-types": "6.26.0",
    "babylon": "6.18.0",
    "clean-webpack-plugin": "^2.0.1",
    "codelyzer": "5.0.1",
    "copy-webpack-plugin": "^5.0.3",
    "css-loader": "~1.0.0",
    "enhanced-resolve": "4.1.0",
    "extract-text-webpack-plugin": "^3.0.2",
    "filewalker": "0.1.3",
    "htmlparser2": "^3.10.1",
    "jasmine-core": "^3.4.0",
    "karma": "^4.1.0",
    "karma-jasmine": "^2.0.1",
    "karma-nativescript-launcher": "^0.4.0",
    "lazy": "1.0.11",
    "nativescript-css-loader": "^0.26.1",
    "nativescript-dev-typescript": "^0.9.0",
    "nativescript-dev-webpack": "^0.21.2",
    "nativescript-worker-loader": "^0.9.5",
    "raw-loader": "^2.0.0",
    "resolve-url-loader": "^2.3.1",
    "tslint": "5.16.0",
    "typescript": "~3.1.1",
    "uglifyjs-webpack-plugin": "^2.1.2",
    "webpack-bundle-analyzer": "^3.3.2",
    "webpack-cli": "^3.3.1",
    "webpack-sources": "^1.3.0",
    "zone.js": "^0.8.4"
  }

I have absolutely no idea what is going on and have been trying different things now.

tralves commented 5 years ago

I had the same problem on mac and tns update fixed...