Errors after installing '#babel/preset-env' - react-native

when I was trying to start my npm project I got the following error:
/home/projects/reactive-weather/reactive-weather/app/node_modules/expo/src/Location.js:
Cannot find module '#babel/preset-env' from '/home/projects/reactive-weather/reactive-weather/app'
Surely I need to install this module but after I did, I'm getting this error:
Error: /home/projects/reactive-weather/reactive-weather/app/node_modules/expo/src/Location.js: Unexpected token, expected ";" (9:5)
7 | const LocationEventEmitter = new NativeEventEmitter(NativeModules.ExponentLocation);
8 |
> 9 | type ProviderStatus = {
| ^
10 | locationServicesEnabled: boolean,
11 | gpsAvailable: ?boolean,
12 | networkAvailable: ?boolean,
10:43:44 AM: Failed building JavaScript bundle
Everything was perfectly fine, the last thing I've done before this happened was using git commands like: git stash also I had to perform npm audit fix but I don't think any libs were vulnerable.

Related

After make an npm update the console shows Error: Module not found: Error: Can't resolve 'angular2-moment'

I was trying to install jquery on my Angular project and after write some jquery dependency on package.json doc and type npm update, the console says Error: Module not found: Error: Can't resolve 'angular2-moment'.
Error occurs in the template of component RegisterComponent.
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
× Failed to compile.
✔ Browser application bundle generation complete.
Initial Chunk Files | Names | Raw Size
main.js | main | 83.62 kB |
runtime.js | runtime | 6.51 kB |
4 unchanged chunks
Build at: 2023-01-10T02:39:00.432Z - Hash: 2a1b1b37176d6913 - Time: 536ms
./src/app/app.module.ts:7:0-47 - Error: Module not found: Error: Can't resolve 'angular2-moment' in 'C:\Users\xxxxxx\Desktop\Proyectos IT\registro_cintas\client\src\app'
Error: src/app/app.component.html:6:34 - error NG8002: Can't bind to 'routerLink' since it isn't a known property of 'a'.
6 <a class="link-home" [routerLink]="['/home']">
continue...
~~~~~~~~~~~~~~~~~~~~~~~~
I tryed installing ngx-moment, angular2-moment again or uninstalling this last one algo I erase the entire folder and made a git clone from the last working commit but nothing, I think the angular2-moment it's not compatible with my Angular version but I don't know what to do.

npm - gulp-sass no longer has a default Sass compiler; please set one yourself

Keep getting this error when trying to build templates
[09:21:08] Requiring external module babel-register
[09:21:19] Using gulpfile ~/GIT/Newsletters/gulpfile.babel.js
[09:21:19] Starting 'build'...
[09:21:19] Starting 'clean'...
[09:21:19] Finished 'clean' after 5.98 ms
[09:21:19] Starting 'pages'...
[09:21:20] Finished 'pages' after 1.96 s
[09:21:20] Starting 'sass'...
Error in plugin "gulp-sass"
Message:
gulp-sass no longer has a default Sass compiler; please set one yourself.
Both the "sass" and "node-sass" packages are permitted.
For example, in your gulpfile:
const sass = require('gulp-sass')(require('sass'));
When I then add const sass = require('gulp-sass')(require('sass')); in my gulpfile.js
It gives this error
[09:41:01] Requiring external module babel-register
{ TypeError: /Users/lde4k1v/GIT/Newsletters/gulpfile.babel.js: Duplicate declaration "sass"
76 |
77 | // Compile Sass into CSS
> 78 | function sass() {
| ^
79 | return gulp.src('src/assets/scss/app.scss')
80 | .pipe($.if(!PRODUCTION, $.sourcemaps.init()))
81 | .pipe($.sass({
Here is my full gulpfile.babel.js
Can someone help me out :( already searched quite some time on it and can't find seem to fix it sadly

fbBatchedBridgeConfig is not set

I'm having an error while running yarn test on react native mobile application.
Test suite failed to run
Invariant Violation: __fbBatchedBridgeConfig is not set, cannot invoke native modules
2 | // import console = require('console');
3 |
> 4 | if (!NativeModules.DeviceMotionModule) {
| ^
5 | throw new Error('Native modules for sensors not available. Did react-native link run successfully?')
6 | }
7 |
at invariant (node_modules/invariant/invariant.js:40:15)
at Object.invariant (node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:162:3)
at Object.require [as NativeModules] (node_modules/react-native/Libraries/react-native/react-native-implementation.js:322:12)
at Object.NativeModules (src/NativeModules/SensorsIOS/sensors.js:4:6)
I'm new to testing with jest.
I have a set of costum native modules for IOS and Android in my project (not an npm module).

Error when run gulp start

I'm searching and searching and I can´t find the error.
Now I hope someone help me.
npm -v
[18:54:13] Requiring external module babel-core/register
[18:54:13] CLI version 3.9.0
[18:54:13] Local version 3.9.0
gulp -v
5.6.0
$ gulp start
[18:47:59] Requiring external module babel-core/register
/node_modules/babel-core/lib/transformation/file/index.js:558
throw err;
^
SyntaxError: /config/index.js: Unexpected token (31:17)
29 | const bothConfig = require('./both');
30 |
> 31 | export default { ...bothConfig, ...envConfig };
| ^
32 |
at Parser.pp$5.raise (/node_modules/babylon/lib/index.js:4454:13)
at Parser.pp.unexpected (/node_modules/babylon/lib/index.js:1761:8)
at Parser.pp$3.parseIdentifier (/node_modules/babylon/lib/index.js:4332:10)
at Parser.pp$3.parsePropertyName (/node_modules/babylon/lib/index.js:4156:96)
at Parser.parsePropertyName (/node_modules/babylon/lib/index.js:6229:23)
at Parser.pp$3.parseObj (/node_modules/babylon/lib/index.js:4045:12)
at Parser.pp$3.parseExprAtom (/node_modules/babylon/lib/index.js:3719:19)
at Parser.parseExprAtom (/node_modules/babylon/lib/index.js:7238:22)
at Parser.pp$3.parseExprSubscripts (/node_modules/babylon/lib/index.js:3494:19)
at Parser.pp$3.parseMaybeUnary (/node_modules/babylon/lib/index.js:3474:19)
export default{bothConfig, envConfig};

Titanium SDK 5.2.2.GA won't find iOS devices

I have an app that worked fine last year on the earlier versions of sdk but now Titanium SDK 5.2.2.GA won't find iOS devices. I tried cleaning everything about appcelerator and reinstall but no luck. I also tried installing node-ios-device as a global package and in the titanium sdk 5.2.2 folder. What else can I do?
I get the following error:
2016-05-11T09:34:54.590Z | DEBUG | [PLUGIN-LOAD] 0ms /Users/adi/.appcelerator/install/5.2.2/package/appc.js
(node:2212) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
2016-05-11T09:34:54.651Z | DEBUG | [PLUGIN-LOAD] 61ms /Users/adi/.appcelerator/install/5.2.2/package/node_modules/appc-cli-titanium/appc.js
2016-05-11T09:34:54.651Z | DEBUG | run plugin: /Users/adi/.appcelerator/install/5.2.2/package/node_modules/appc-cli-titanium
2016-05-11T09:34:54.652Z | DEBUG | [PLUGIN-LOAD] 0ms /Users/adi/.appcelerator/install/5.2.2/package/node_modules/arrow/appc.js
2016-05-11T09:34:54.654Z | DEBUG | run plugin: /Users/adi/.appcelerator/install/5.2.2/package/node_modules/arrow
2016-05-11T09:34:54.656Z | TRACE | plugin "arrow" failed its "when" function check, skipping...
2016-05-11T09:34:54.657Z | TRACE | loading plugin "titanium" for command "run" CLI options via function
2016-05-11T09:34:54.658Z | TRACE | loading plugin "titanium" for command "run" CLI options via array
2016-05-11T09:34:54.660Z | TRACE | executing command "run" with the following plugins:
["titanium"]
2016-05-11T09:34:54.661Z | TRACE | Attempting to load session info from config file
2016-05-11T09:34:54.662Z | TRACE | check if session is invalidated
2016-05-11T09:34:55.350Z | TRACE | session expiry 1463560847951 false
2016-05-11T09:34:55.351Z | TRACE | session already loaded in opts.session
2016-05-11T09:34:55.352Z | DEBUG | Titanium Downloads Last Checked: 1462957150130
2016-05-11T09:34:55.480Z | TRACE | No project alloy hook; skipping update to 1.0.0
2016-05-11T09:34:56.100Z | ERROR | An uncaught exception was thrown!
Cannot read property 'devices' of undefined
2016-05-11T09:34:56.101Z | ERROR | Cannot read property 'devices' of undefined
2016-05-11T09:34:56.101Z | TRACE | TypeError: Cannot read property 'devices' of undefined
at iOSBuilder.<anonymous> (/Users/adi/Library/Application Support/Titanium/mobilesdk/osx/5.2.2.GA/iphone/cli/commands/_build.js:298:11)
at /Users/adi/Library/Application Support/Titanium/mobilesdk/osx/5.2.2.GA/node_modules/ioslib/index.js:115:12
at /Users/adi/Library/Application Support/Titanium/mobilesdk/osx/5.2.2.GA/node_modules/async/lib/async.js:721:13
at /Users/adi/Library/Application Support/Titanium/mobilesdk/osx/5.2.2.GA/node_modules/async/lib/async.js:52:16
at done (/Users/adi/Library/Application Support/Titanium/mobilesdk/osx/5.2.2.GA/node_modules/async/lib/async.js:241:17)
at /Users/adi/Library/Application Support/Titanium/mobilesdk/osx/5.2.2.GA/node_modules/async/lib/async.js:44:16
at /Users/adi/Library/Application Support/Titanium/mobilesdk/osx/5.2.2.GA/node_modules/async/lib/async.js:718:17
at /Users/adi/Library/Application Support/Titanium/mobilesdk/osx/5.2.2.GA/node_modules/async/lib/async.js:167:37
at /Users/adi/Library/Application Support/Titanium/mobilesdk/osx/5.2.2.GA/node_modules/ioslib/index.js:85:6
at /Users/adi/Library/Application Support/Titanium/mobilesdk/osx/5.2.2.GA/node_modules/ioslib/lib/device.js:51:12
For anybody who encounters this, the problem is the NodeJS version, I had v6.2.0 and downgraded to v4.4.4. All works now.
Thanks Adi, I had the exact same issue v6.2.0 of Node and downgraded to v4.4.x and all works for me as well.