Expo error when trying to global install CLI after update - expo

After I started Expo, I got the message I was running an a older version of the client and asked me to run npm install -g expo-cli , so I foolishly did.
After the install was finished I ran expo start and got the following question:
This command requires Expo CLI.
Do you want to install it globally [Y/n]?
To what I replied with: Y and got the following respond:
Installing the package 'expo-cli'...
events.js:167
throw er; // Unhandled 'error' event
^
Error: spawn npm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:229:19)
at onErrorNT (internal/child_process.js:406:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:235:12)
at onErrorNT (internal/child_process.js:406:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
I've tried:
expo diagnostics
But am met with the same response.
Anyone knows how I can solve this problem?

I restarted my laptop and ran npm install -g expo-cli this somehow solved the problem.

A quick around would be to remove expo and expo.cmd in node_modules/.bin since it seems to be using the expo in node_modules/.bin and not the global one.

Related

Getting an error when trying to install Truffle on Windows Powershell

I'm trying to install Truffle by using this command:
npm install -g truffle#5.0.2
and I get the following message:
npm WARN deprecated mkdirp#0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
I downloaded Node.js v16.13.2 as well. Any clue what the error is all about?
Thanks!
The message you have posted is a WARN (warning) and not an ERR (error), so there should be no problem with installing truffle in the system. I don't have windows rn, so I don't know what is your exact issue but if it is just WARN than there should be no problem installing NPM package.

When i install flask via conda, it throws ERROR [PermissionError 13, Permission Denied]?

if i try to install flask via conda using
conda install -c anaconda flask
it shows that some packages would be installed but later i throws error stating
Preparing transaction: done
Verifying transaction: done
Executing transaction: failed
ERROR conda.core.link:_execute(502): An error occurred while uninstalling package 'defaults::conda-4.5.4-py36_0'.
PermissionError(13, 'Access is denied')
Attempting to roll back.
Rolling back transaction: done
PermissionError(13, 'Access is denied')".
I think this means you need to install it as an administrator. Check out this issue on github for specific instructions.

getting error whenever try to deploy backend with cdk via gitlab , in local it will works as expected

I am trying to deploy backend serverless resources with CDK in AWS cloud but getting errors while deploying things via GitLab build.
trying with a local visual studio it works fine.
error is below :
$ npm run deploy-backend
> ui-dashboard-infra#0.0.0 deploy-backend /builds/project/control-panel/infra
> cdk deploy --app 'ts-node stacks/backend' --all --require-approval never
Bundling asset dashboard-A/restFunctionFallbackus-east-1/Code/Stage...
/builds/project/control-panel/infra/node_modules/#aws-cdk/core/lib/asset-staging.ts:398
throw new Error(`Failed to bundle asset ${this.node.path}, bundle output is located at ${bundleErrorDir}: ${err}`);
^
Error: Failed to bundle asset dashboard-A/restFunctionFallbackus-east-1/Code/Stage, bundle output is located at /builds/project/control-panel/infra/cdk.out/bundling-temp-4607286efdd890681baca6f8a5d9b9b32929fa84e9947500fbe203e5b5d06a0f-error: Error: spawnSync bash ENOENT
at AssetStaging.bundle (/builds/project/control-panel/infra/node_modules/#aws-cdk/core/lib/asset-staging.ts:398:13)
at AssetStaging.stageByBundling (/builds/project/control-panel/infra/node_modules/#aws-cdk/core/lib/asset-staging.ts:246:10)
at stageThisAsset (/builds/project/control-panel/infra/node_modules/#aws-cdk/core/lib/asset-staging.ts:137:35)
at Cache.obtain (/builds/project/control-panel/infra/node_modules/#aws-cdk/core/lib/private/cache.ts:24:13)
at new AssetStaging (/builds/project/control-panel/infra/node_modules/#aws-cdk/core/lib/asset-staging.ts:162:44)
at new Asset (/builds/project/control-panel/infra/node_modules/#aws-cdk/aws-s3-assets/lib/asset.ts:68:21)
at AssetCode.bind (/builds/project/control-panel/infra/node_modules/#aws-cdk/aws-lambda/lib/code.ts:180:20)
Subprocess exited with error 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ui-dashboard-infra#0.0.0 deploy-backend: `cdk deploy --app 'ts-node stacks/backend' --all --require-approval never`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ui-dashboard-infra#0.0.0 deploy-backend 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! /root/.npm/_logs/2021-08-10T08_29_17_449Z-debug.log
I have faced a similar kind of issue, and the problem is that there is a bug in cdk versions prior to the once released before 25th Feb 2021.
For that, please make sure either you are using the latest version of cdk, or you DO NOT HAVE ANY WHITE SPACES IN YOUR FILE PATHNAME (any directory name having space or your username that has a space might cause this problem). Once I removed the white spaces from the pathname, everything started to work as expected.
I got the same error as you. In my case, the issue was that I had esbuild installed as a dependency in the CDK folder, but not in the folder of my Lambda function.
I was able to fix the issue by installing esbuild as a dev dependency in my Lambda function folder. If you don't want to do that, you can also install it globally in your pipeline by adding the command npm i -g esbuild to your pipeline (consider pinning it to a particular version ie. npm i -g esbuild#x.y.z).
No idea why it was working locally without esbuild installed in the function folder, but then broke when doing the same thing in a Gitlab pipeline… I didn't have esbuild installed globally on my local machine or anything.

Update expo-cli to latest version ( 3.21.3 ) failed

I'm trying to update my expo cli to latest version but it gave an error like this
how to fix this ? I'm doing nothing
try running this:
npm cache clean --force
after that, try installing again

ENOENT error when doing ionic start

I upgraded to beta.23 and started to get an error when created a new project using 'ionic start foo --v2 --verbose'.
The error in red says
"Unable to spawn commandError: spawn npm ENOENT (CLI v2.0.0-beta.23)."
I have npm installed and can run from Windows 8 cmd line.
I tried upgrade to node v5.9.1.
I confirmed npm is in the PATH environment variable and can run npm from cmd shell.
Any ideas how to fix or debug further would be appreciated.
Here is the complete output:
C:\ionic2>ionic start foo --v2 --verbose
Task setting: title=start, name=start, summary=Starts a new Ionic project in the
specified PATH, [options]=any flags for the command, <PATH>=directory for the n
ew project, [template]=Starter templates can either come from a named template,
(ex: tabs, sidemenu, blank),
a Github repo, a Codepen url, or a local directory.
Codepen url,
Defaults to Ionic "tabs" starter template, --appname|-a=Human readable name for
the app (Use quotes around the name), --id|-i=Package name for <widget id> confi
g, ex: com.mycompany.myapp, title=Skip npm package installation, boolean=true, t
itle=Create a basic structure without Cordova requirements, boolean=true, title=
Setup the project to use Sass CSS precompiling, boolean=true, title=List starter
templates available, boolean=true, --io-app-id=The Ionic.io app ID to use, --te
mplate|-t=Project starter template, boolean=true, title=Start a Ionic v2 project
, boolean=true, title=(with --v2 only) Use TypeScript in starter, --zip-file|-z=
URL to download zipfile for starter template, module=./ionic/start, disableChang
ePwd=true
Utils.preprocessCliOptions _=[start, foo], skip-npm=false, no-cordova=false, w=f
alse, sass=false, s=false, list=false, l=false, v2=true, v=false, typescript=fal
se, -ts=false, verbose=true, $0=C:\Program Files\nodejs\node.exe C:\Users\bradtk
e\AppData\Roaming\npm\node_modules\ionic\bin\ionic
One awesome Ionic app coming right up...
Creating Ionic app in folder C:\ionic2\foo based on tabs project
Downloading: https://github.com/driftyco/ionic2-app-base/archive/master.zip
[=============================] 100% 0.0s
Downloading: https://github.com/driftyco/ionic2-starter-
tabs/archive/master.zip
[=============================] 100% 0.0s
Installing npm packages...
Running exec command: npminstall
Utils.fail Unable to run spawn commandError: spawn npm ENOENT undefined
Utils.fail stack undefined
Utils.errorHandler is set, calling that now
Cli.Utils.errorHandler msg Unable to run spawn commandError: spawn npm ENOENT st
ring
Unable to run spawn commandError: spawn npm ENOENT (CLI v2.0.0-beta.23)
Your system information:
Cordova CLI: 6.1.0 (cordova-lib#undefined)
Ionic CLI Version: 2.0.0-beta.23
Ionic App Lib Version: 2.0.0-beta.13
OS: Windows 8.1
Node Version: v5.9.1
Regards,
bruce
I have the exact same issue. Worked in beta 22.
Reverting to the earlier beta resolved the issue:
npm install -g ionic#2.0.0-beta.22
Move into folder of your application and run npm install. I don't know what is happening but sound like start script trying to execute npminstall rather than npm install:
Installing npm packages...
Running exec command: npminstall
This is a known issue with the CLI on windows. Downgrading to cli beta22 can work as workaround for now, but this will be fixed in the next release
Upgrading npm worked for me.
npm install -g npm