feathers-client ionic2 - Cannot find module 'events' - only in Windows10 - windows

I am building a featherjs using socketIO backend with an Ionic2 frontend.
This code seems to be working fine in an Ubuntu environment. However I'm trying to setup a dev environment on windows 10, and getting the following error.
I have previously setup typings for feathers-client using the instructions found here:
https://berndsgn.ch/angular2-and-feathersjs/
(again, this is working in Ubuntu but not in Windows10)
Here is the output:
C:\Users\mickt_000\Documents\tumble\tumble-app>ionic serve
Starting app-scripts server: --port 8100 --livereload-port 35729 --address 0.0.0.0 - Ctrl+C to cancel
[09:58:38] watch started ...
[09:58:38] build dev started ...
[09:58:38] clean started ...
[09:58:38] clean finished in 2 ms
[09:58:38] copy started ...
[09:58:38] transpile started ...
[09:58:41] typescript: ...rs/mickt_000/Documents/tumble/tumble-app/node_modules/feathers-client/index.d.ts, line: 1
Cannot find module 'events'.
L1: import events = require('events');
[09:58:41] transpile failed
[09:58:41] dev server running: http://localhost:8100/
[09:58:41] copy finished in 3.52 s
[09:58:41] watch ready in 3.61 s
Some additional info
C:\Users\mickt_000\Documents\tumble\tumble-app>npm install --save events
Tumble-App# C:\Users\mickt_000\Documents\tumble\tumble-app
+-- events#1.1.1
+-- feathers#2.1.2
| `-- events#1.1.1 deduped
`-- feathers-client#2.2.0
`-- feathers#2.1.1
`-- events#1.1.1 deduped
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN #ionic/cli-plugin-ionic-angular#1.0.0 requires a peer of #ionic/app-scripts#^1.3.1 but none was installed.
npm WARN The package #types/socket.io-client is included as both a dev and production dependency.
C:\Users\mickt_000\Documents\tumble\tumble-app>npm -v
4.5.0
C:\Users\mickt_000\Documents\tumble\tumble-app>node -v
v6.10.3
I have also tried reinstalling cordova ionic and also performed npm clean cache.
Many thanks in advance.

Related

AWS Amplify Build Error - Mismatched Brackets Found In The Schema

End Desire:
To build my AWS Amplify project in the dev environment, using full-stack CI/CD. So for example, pushing my changes to Code Commit will build the backend resources.
Build Logs:
2023-01-06T06:19:26.457Z [INFO]: [33mNote: It is recommended to run this command from the root of your app directory[39m
2023-01-06T06:19:27.797Z [WARNING]: - Initializing your environment: dev
2023-01-06T06:19:29.164Z [WARNING]: - Building resource api/project
2023-01-06T06:19:33.756Z [WARNING]: - Building resource auth/project
2023-01-06T06:19:33.902Z [WARNING]: - Building resource storage/project
2023-01-06T06:19:33.939Z [WARNING]: ✔ Initialized provider successfully.
2023-01-06T06:19:34.452Z [WARNING]: ✖ There was an error initializing your environment.
2023-01-06T06:19:34.453Z [INFO]: 🛑 Syntax Error: mismatched brackets found in the schema. Unexpected ) at line 239 in the schema.
2023-01-06T06:19:34.453Z [INFO]: Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/
buildspec.yml:
version: 0.1
frontend:
phases:
preBuild:
commands:
- npm i
build:
commands:
- npm run build
artifacts:
baseDirectory: .next
files:
- '**/*'
cache:
paths:
- node_modules/**/*
Checks:
I have checked the graphql.schema for errors.
I have removed the testing section in the buildspec.
I have added amplify push --simple as recommended here
I've ran npm run build on my local CLI successfully
In the AWS Amplify console, under build settings, the AWS CLI version was "latest". Changing the AWS CLI version to 10.4.0 fixed the issue.
View AWS CLI Versioning here: https://www.npmjs.com/package/#aws-amplify/cli?activeTab=versions
Rather than going to 10.4.0, go back a couple versions from the latest AWS CLI version at the time.

Nuxtjs - Nuxt/Image module having issues on deployment

Im building a static page in nuxtjs. I added the module nuxt/image and set it up according to the instructions in the documentation. (static with self hosted images)
ssr:true,
target: 'statics",
buildModules: [
// https://go.nuxtjs.dev/vuetify
'#nuxtjs/vuetify',
//https://image.nuxtjs.org
'#nuxt/image'
],
<nuxt-link :to="localePath('/')">
<nuxt-img
id="header-logo"
format="webp"
src="/logos/logo.png">
</nuxt-img>
</nuxt-link>
When i run npm run dev the project compiles but then the development server exists without any errors.
When I deploy it to the server through github actions the action breaks and exits on nuxt generate with the exit code: /home/githubaction/actions-runner/workspace/_temp/eb47b4c6-6c0d-42cc-[9](https://github.com/xxxxxx/xxxxx/runs/6722739489?check_suite_focus=true#step:9:10)019-dca85b061dda.sh: line 1: 17085 Segmentation fault npm run generate Error: Process completed with exit code 139.
Any idea why is that?
Update
I downgraded from version 0.6.2 to 0.6.0 and this seems to resolve the issue.

Not able to generate Angular app based on running business network

When trying to follow the instructions (https://fabric-composer.github.io/tasks/genapp.html) to generate an Angular app based on a running business network I'm getting a No bower.json present error, using the defaultProfile. It seems to generate a node_modules directory but it's empty, however no angular-app directory is created. I was able to get the app generated by pointing at an existing BNA file as outlined in step 2 of the document but wasn't ideal. Any idea of what mind be going on?
jdockter#ubuntu:~$ yo fabric-composer:angular
WARNING: No configurations found in configuration directory:/home/jdockter/config
WARNING: To disable this warning set SUPPRESS_NO_CONFIG_WARNING in the environment.
Welcome to the Angular2 skeleton app generator
? Do you want to connect to a running Business Network? Yes
? What is the name of the application you wish to generate?: angular-app
? Description of the application: Skeleton Fabric Composer Angular2 project
? Author name: Jon Dockter
? Author email: jdockter#us.ibm.com
? What is the Business Network Identifier?: labor-network-model
? What is the Connection Profile to use? defaultProfile
? Enrollment id: WebAppAdmin
? Enrollment Secret: DJY27pEnl16d
Configuring: angular-app
About to connect to a running business network
I'm all done. Running npm install && bower install for you to install the required dependencies. If this fails, try running the command yourself.
npm WARN enoent ENOENT: no such file or directory, open '/home/jdockter/package.json'
npm WARN jdockter No description
npm WARN jdockter No repository field.
npm WARN jdockter No README data
npm WARN jdockter No license field.
bower ENOENT No bower.json present
Complete
I created this defect to track this:
https://github.com/fabric-composer/fabric-composer/issues/206
Will update here as soon as we know more.
Thanks for the report.

Aurelia, installation issue with webpack

I wanted to try Aurelia today but I have an issue with the webpack skeleton.
So, I have downloaded the webpack skeleton on the official website, and I started the npm install and start script.
But when I browse to http://localhost:9000/ I have a lot of errors.
Html Webpack Plugin:
TypeError: Cannot read property 'request' of undefined
- ExternalModuleFactoryPlugin.js:37 handleExternals
[aurelia]/[config-generate-index-html]/[webpack]/lib/ExternalModuleFactoryPl ugin.js:37:33
- ExternalModuleFactoryPlugin.js:46 next
[aurelia]/[config-generate-index-html]/[webpack]/lib/ExternalModuleFactoryPl ugin.js:46:8
- ExternalModuleFactoryPlugin.js:59 handleExternals
[aurelia]/[config-generate-index-html]/[webpack]/lib/ExternalModuleFactoryPl ugin.js:59:7
- ExternalModuleFactoryPlugin.js:79 ExternalModuleFactoryPlugin.
[aurelia]/[config-generate-index-html]/[webpack]/lib/ExternalModuleFactoryPl ugin.js:79:5
- NormalModuleFactory.js:177
[aurelia]/[webpack]/lib/NormalModuleFactory.js:177:3
- Tapable.js:123 NormalModuleFactory.applyPluginsAsyncWaterfall
[aurelia]/[webpack]/[tapable]/lib/Tapable.js:123:70
- NormalModuleFactory.js:161 NormalModuleFactory.create
[aurelia]/[webpack]/lib/NormalModuleFactory.js:161:8
- Compilation.js:356 Compilation.process [as _addModuleChain]
[aurelia]/[webpack]/lib/Compilation.js:356:16
- Compilation.js:427 Compilation.process [as addEntry]
[aurelia]/[webpack]/lib/Compilation.js:427:7
- SingleEntryPlugin.js:22 SingleEntryPlugin.
[aurelia]/[config-generate-index-html]/[webpack]/lib/SingleEntryPlugin.js:22 :15
- Tapable.js:156 Compiler.applyPluginsParallel
[aurelia]/[webpack]/[tapable]/lib/Tapable.js:156:14
- Compiler.js:431 Compiler.compile
[aurelia]/[webpack]/lib/Compiler.js:431:7
- Compiler.js:237 Compiler.runAsChild
[aurelia]/[webpack]/lib/Compiler.js:237:7
- compiler.js:70
[aurelia]/[config-generate-index-html]/[html-webpack-plugin]/lib/compiler.js :70:19
- compiler.js:69 Object.compileTemplate
[aurelia]/[config-generate-index-html]/[html-webpack-plugin]/lib/compiler.js :69:10
- index.js:47 Compiler.
[aurelia]/[config-generate-index-html]/[html-webpack-plugin]/index.js:47:40
- Tapable.js:156 Compiler.applyPluginsParallel
[aurelia]/[webpack]/[tapable]/lib/Tapable.js:156:14
- Compiler.js:431 Compiler.compile
[aurelia]/[webpack]/lib/Compiler.js:431:7
- Compiler.js:47 Watching.
[aurelia]/[webpack]/lib/Compiler.js:47:17
I use 2.15.9 npm version and 4.5.0 node version.
Your npm version must be 3 or greater. Update npm using npm install npm -g then install the packages again.

compass:dist & execFile("compass.bat", ...) - Warning: spawn EPERM

First of all, I am pretty new to (modern) web development and I tried to import an existing project into my WebStorm and run a Grunt task.
It stops at "compass:dist" with:
$ node.exe C:\Users\lgr\AppData\Roaming\npm\node_modules\grunt-cli\bin\grunt --gruntfile C:\Users\lgr\workspace\js\rit-workshop\ui\Gruntfile.js buildall
Initializing
Command-line options: --gruntfile=C:\Users\lgr\workspace\js\rit-workshop\ui\Gruntfile.js, --verbose
Reading "Gruntfile.js" Gruntfile...OK
Registering Gruntfile tasks.
Registering "grunt-bump" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-bump\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-bump\package.json...OK
Loading "bump.js" tasks...OK
+ bump, bump-commit, bump-only
Registering "grunt-html2js" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-html2js\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-html2js\package.json...OK
Loading "html2js.js" tasks...OK
+ html2js
Registering "grunt-contrib-clean" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-clean\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-clean\package.json...OK
Loading "clean.js" tasks...OK
+ clean
Registering "grunt-contrib-copy" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-copy\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-copy\package.json...OK
Loading "copy.js" tasks...OK
+ copy
Registering "grunt-contrib-concat" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-concat\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-concat\package.json...OK
Loading "concat.js" tasks...OK
+ concat
Registering "grunt-contrib-cssmin" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-cssmin\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-cssmin\package.json...OK
Loading "cssmin.js" tasks...OK
+ cssmin
Registering "grunt-contrib-watch" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-watch\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-watch\package.json...OK
Loading "watch.js" tasks...OK
+ watch
Registering "grunt-contrib-jshint" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-jshint\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-jshint\package.json...OK
Loading "jshint.js" tasks...OK
+ jshint
Registering "grunt-contrib-uglify" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-uglify\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-uglify\package.json...OK
Loading "uglify.js" tasks...OK
+ uglify
Registering "grunt-karma" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-karma\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-karma\package.json...OK
Loading "grunt-karma.js" tasks...OK
+ karma
Registering "grunt-conventional-changelog" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-conventional-changelog\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-conventional-changelog\package.json...OK
Loading "changelog.js" tasks...OK
+ changelog
Registering "grunt-ngdocs" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-ngdocs\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-ngdocs\package.json...OK
Loading "grunt-ngdocs.js" tasks...OK
+ ngdocs
Registering "grunt-contrib-compass" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-compass\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-compass\package.json...OK
Loading "compass.js" tasks...OK
+ compass
Registering "grunt-contrib-requirejs" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-requirejs\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-requirejs\package.json...OK
Loading "requirejs.js" tasks...OK
+ requirejs
Reading package.json...OK
Parsing package.json...OK
Initializing config...OK
Loading "Gruntfile.js" tasks...OK
- watch
+ BuildCommit, after-test, archive, archiveNONmin, buildall, buildjs, buildjsCommit, buildjsNONmin, buildjsNONminCommit, css, cssmy, default, delta, incrementBuild, shell, templates, test, watch
Running tasks: buildall
Running "buildall" task
Running "clean:buildall" (clean) task
Verifying property clean.buildall exists in config...OK
Files: [no src]
Options: force=false, no-write=false
>> 0 paths cleaned.
Running "css" task
Running "compass" task
Running "compass:dist" (compass) task
Verifying property compass.dist exists in config...OK
File: [no files]
Options: config="config.rb"
Warning: spawn EPERM Use --force to continue.
Aborted due to warnings.
I tried googling a bit, but all I seem to get is that this is a permission error, but I don't know where to start to fix it.
I tried cleaning the project, reinstalling Ruby for Windows, reinstalling compass inside of ruby. Nothing worked.
Update:
I tried debugging the build and in file bin-version\index.js the line
execFile(bin, ['--version'], function (err, stdout, stderr) {
seems to throw the error as the debugger wouldn't go beyond this point. The bin is compass.bat and it looks like the build has some permission error? When I open my cmd and type "compass --version" it just works fine. I have the ruby/bin in my classpath aswell where the compass.bat is placed.
Running "compass:dist" (compass) task
Verifying property compass.dist exists in config...OK
File: [no files]
Options: config="config.rb"
Warning: spawn EPERM Use --force to continue.
Does anyone know about what could cause this error?
I solved this, but I can't tell exactly what caused it. What I can say is that it has nothing to do with compass itself, wrong permissions or Windows - it has to do with a wrong project setup. So, if you get this error, check your setup and if every dependency is available.

Resources