IBM Cloud Node-RED Manage Palette doesn't install items - ibm-cloud

I'm on IBM Cloud trying to install node-red-node-smooth from the manage palette, and I'm getting an error. I've tried several other packages as well. The error that I get in my debug log shows:
npm WARN saveError ENOENT: no such file or directory, open '/home/vcap/app/.node-red/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/vcap/app/.node-red/package.json'
npm WARN .node-red No description
npm WARN .node-red No repository field.
npm WARN .node-red No README data
npm WARN .node-red No license field.
+ node-red-node-smooth#0.1.0
updated 1 package in 4.726s
npm ERR! Object.entries is not a function
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vcap/app/.npm/_logs/2018-05-10T15_01_53_296Z-debug.log
The log file has a stack trace that starts with this:
106 verbose stack TypeError: Object.entries is not a function
Is there something obvious that I'm doing wrong?

instances deployed in the last few days got npm 6.0.0. This version of npm contained a bug that caused the Object.entries is not a function error.
npm released 6.0.1 that fixed this issue today (Thursday May 10th 2018)
You have three possible ways to fix your instance:
deploy a new instance and copy your flows over
or, set the NPM_CONFIG_AUDIT environment variable* to false - which stops npm 6.0.0 going down the code path containing the bug.
or, set the NODE_MODULE_CACHE environment variable* to false and trigger a restage of your application - that will get npm 6.0.1 installed.
If you don't have much in the way of flows at this point, deleting and creating a new instance is the easiest option.
If you want to 'repair' your existing instance, option 2 is probably the easiest as it just requires an automatic restart of the app, rather than a restage which requires the cf command-line tool to trigger manually.
To set an environment variable within your IBM Cloud application, go to your application's dashboard page. Go to the Runtime section in the left-hand navigation. Select 'Environment Variables' in the tabs across the top and scroll down to the 'User defined' section of the page. Click 'Add' - enter the env var details and click 'Save'. Your app will be restarted with the variable set.

Related

gatsby-source-contentful options error on build

some time back I made a site with Gatsby and I've used static markdown for my pages.
Now I wanted to move all my posts on Contentful and everything works fine in development.
When I went on Netlify to deploy my website it threw me an error.
I've looked for solutions but haven't found one yet.
I tried to run the build locally and it throws me this error, so I believe I need to fix this first before deploying.
ERROR
Problems with gatsby-source-contentful plugin options:
spaceId: undefined - "spaceId" is required
accessToken: undefined - "accessToken" is required
host (default value): "cdn.contentful.com"
environment (default value): "master"
downloadLocal (default value): false
localeFilter (default value): [Function]
forceFullSync (default value): false
pageLimit (default value): 100
useNameForId (default value): true
not finished onPreBootstrap - 0.056s
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gatsby-starter-hello-world#0.1.0 build: `gatsby build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gatsby-starter-hello-world#0.1.0 build 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! C:\Users\user\AppData\Roaming\npm-cache\_logs\2020-05-13T15_20_35_160Z-debug.log
Apparently it does not read the .env variables. I do have the variables set on Netlify and as I said earlier on development it works just fine without throwing any kind of error.
I did not have 'dotenv' installed before and tried to install it but did not solve the issue.
I do have only one '.env' file, but have tried to make '.env.development' and '.env.production' files but did not work.
How can I fix the problem?
As an extra I do get some errors, on Netlify only, such as
error There was an error in your GraphQL query:
Unknown type "ContentfulFluid".
but I do not think they cause the build to fail.
EDIT:
I should add that if I do write the .env variables as strings the build does run locally, which makes me believe it would do on deployment.
You have to set your .env variables in Netlify with GATSBY_ prefix. So, your CONTENTFUL_ID variable will be GATSBY_CONTENTFUL_ID.
It's recommended to use the same naming in your local and build environment to keep the logic between them. So, you will need to prefix all references to .env using GATSBY_ in your local environment too. To do this, you may need to create a .env.development and .env.production if you haven't set it before.
You can check for further information in Netlify documentation:
Gatsby environment variables
Any environment variables prefixed with GATSBY_ will be processed by
Gatsby and made available in the browser for client-side JavaScript
access. Visit the Gatsby docs about environment variables for more
information.
As well as in Gatsby's documentation.
After many attempts trying to debug my code and installing previous versions of gatsby-source-contentful I found out that you would get an error if you have no Media on contentful.
To fix any similar error all you need to do is add a dummy media on contentful itself and it would work just fine.
In the environment variable .env.development you need to add
CONTENTFUL_SPACE_ID = <Paste here your space Id>
CONTENTFUL_ACCESS_TOKEN = <Paste here your delivery API - access token>

spawn EACCES error when serving ionic app

I am using Ionic CLI version 4.2.1 and Ionic Framework version 3.9.2. When I try and use ionic server in my app I get this error:
Error: spawn EACCES
at _errnoException (util.js:992:11)
at ChildProcess.spawn (internal/child_process.js:323:11)
at Object.exports.spawn (child_process.js:502:9)
at spawn
(/usr/local/lib/node_modules/ionic/node_modules/cross-
spawn/index.js:17:18)
at spawn
(/usr/local/lib/node_modules/ionic/node_modules/#ionic/cli-
framework/utils/shell.js:131:12)
at ShellCommand.spawn
(/usr/local/lib/node_modules/ionic/node_modules/#ionic/cli-
framework/utils/shell.js:120:16)
at Shell.
(/usr/local/lib/node_modules/ionic/lib/shell.js:161:27)
at Generator.next ()
at fulfilled
(/usr/local/lib/node_modules/ionic/node_modules/tslib/tslib.js:104:62)
at
I got the codebase from another person using the same versions as me, but I have not been able to run it once on my machine.
This is either a permission issue or a a node_modules issue. It's because you transfered the full project folder from another computer.
To resolve the issue, run :
npm rebuild
To clear npm cache and rebuild your modules
And :
chmod 755 -R /yourpath/to/node_modules
The error may be caused by an installation of a module which was made insudo mode

Google Speech to Text iOS app example: could not build module 'googleapis'

Has anyone been able to successfully build Google's Speech to Text iOS example in Swift 4?
The swift project posted to the Github repo: GoogleCloudPlatform/ios-docs-samples does not seem to be well-maintained. When I open the workspace example, I immediately get 3 build errors in locating header files and "could not build module googleapis."
On installing googleapis
I looked up documentation on pod install for pod 'googleapis', :path=> "." but this produces the following error: [!] No podspec found for googleapis in . I found the googleapis.podspec and downloaded the .zip file and when I did a pod install, got this error:
[!] /bin/bash -c
set -e
Pods/!ProtoCompiler/protoc --plugin=protoc-gen-grpc=Pods/!ProtoCompiler-gRPCPlugin/grpc_objective_c_plugin --objc_out=. --grpc_out=. -I . -I Pods/!ProtoCompiler google//.proto google////.proto google//.proto: No such file or directory
On $ npm install googleapis, I get errors:
npm WARN saveError ENOENT: no such file or directory, open '/Users/grehce/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/Users/grehce/package.json'
npm WARN grehce No description
npm WARN grehce No repository field.
npm WARN grehce No README data
npm WARN grehce No license field.
On locating Header files
Even after pointing it to the correct path in Build Settings > Header Search Paths, the headers are still unable to be found.
missing header file even though it exists
added Header Search Paths
If someone can help correct those above 2 issues OR provide a working iOS example of the Google Speech to Text integrated .xcodeproj example, would be much appreciated!
Github: https://github.com/GoogleCloudPlatform/ios-docs-samples/issues/89
I had problems getting this sample to work as well until I realised that that you are supposed to run the script ./INSTALL-COCOAPODS instead of just doing a regular pod install. This fixes up some paths after installing the pods. Alternatively, you can follow the instructions in the BUILDFIXES file in the repo.
It's annoying that it doesn't just work like any other project, but at least, once you read the manual, it is an easy enough fix.
This is very annoying and bears better documentation from Google's part.
On installing googleapis
You must add the "google" folder from the iOS example project into the same folder as your xcodeproj (sort of alluded to here: https://github.com/GoogleCloudPlatform/ios-docs-samples/issues/19)
You must ignore the "Cannot load underlying module for googleapis" and force build after the googleapis pod install has succeeded. Apparently, "Cannot load underlying module for x" is an xcode bug (Cocoapods + Cannot load underlying module for 'x')
note:
pod 'googleapis', :path=> "."

Gulp watch shows a lot of eslint errors. Which dependencies are missing?

I made a git clone app Ionic 1 made with Generator-M-Ionic
I've done the following steps to install the dependencies:
npm install
bower install
npm install --global gulp-cli
And the prerequisites of the generator itself:
npm i -g yo gulp bower
npm i -g generator-m-ionic
After that the command
gulp watch
The terminal performs normal
[13:58:09] Starting 'jsonlint'...
[13:58:10] Finished 'watch' after 191 ms
[Browsersync] Access URLs:
----------------------------------------
Local: http://localhost:3000
External: http://192.168.100.235:3000
----------------------------------------
UI: http://localhost:3001
UI External: http://192.168.100.235:3001
----------------------------------------
[Browsersync] Serving files from: app
[Browsersync] Serving files from: .tmp
[13:58:10] Finished 'jsonlint' after 488 ms
But several errors like this below appear later in the terminal and my browser only opens an empty screen.
app/main/controllers/logoutCtrl.js
2:1 error "SocialWaveApp" is not defined no-undef
3:3 warning Unexpected console statement no-console
4:3 error "mixpanel" is not defined no-undef
8:9 error "hideSheet" is defined but never used no-unused-vars
13:32 error "index" is defined but never used no-unused-vars
17:9 error "mixpanel" is not defined no-undef
22:9 warning Unexpected console statement no-console
30:11 error "facebookConnectPlugin" is not defined no-undef
34:13 warning Unexpected console statement no-console
How to find out what are the dependencies and what is missing?
The problem was with some dependencies like fserve which only runs on Mac, so the solution was move to a macbook, now the app work.
The eslint errors only show that my project is not using the JS guide lines.

Error with Spawned command: npminstall

I am trying to run a sample application from
https://ionicframework.com/getting-started/.
But I am getting the error - there was an error with the spawned process: npminstall every time I try to run the application. Any help is highly appreciated.
For me it was only to upgrade to new version of npm
npm install -g npm
Spawned command error comes when you try to start a new ionic or cordova app, that gets downloaded from git. This error occurs because your network proxy blocks download a new blank app from git.
To avoid such kind of error try removing the proxies.
1. If you are in a company using their proxy its not possible to do that, so use your own data to do that.
Try downloading a blank app from git using your own data, don't use company network which has proxy enabled.
It will download but while installing the app you will get error like:
Error with start undefined.
Error with spawned command npminstall.
Don't worry a folder will be downloded,
Go to cmd and go inside that app directory and run ionic serve
It will give error like ionic.config.json file didn't find.
create a file with the name ionic.config.json inside the app file.
inside that file paste the following:
{ "name": "your app name", "app_id": "", "v2": true, "typescript": true }
now try running the command ionic serve
your app will run.
I had the similar problem but it worked for me.
install npm globally
npm install -g npm
create a app without installing its packages
ionic start app --v2 --skip-npm
seems ok till now?then
cd app
install packages
npm install --save
done!try to start your ionic app
ionic serve