A utility CLI has unexpectedly closed (exit code 1): Ionic - ionic-framework

I have downloaded the code from the github and when I try to execute it(using ionic serve command) I'm facing an error as
ionic-app-scripts serve --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser
[app-scripts] D:\project-1\project-1\frontend\node_modules\node-sass\lib\binding .js:15
[app-scripts] throw new Error(errors.missingBinary());
[app-scripts] ^
[app-scripts] Error: Missing binding D:\project-1\project-1\frontend\node_module s\node-sass\vendor\win32-x64-64\binding.node
[app-scripts] Node Sass could not find a binding for your current environment: W indows 64-bit with Node.js 10.x
[app-scripts] Found bindings for the following environments:
[app-scripts] - Windows 64-bit with Node.js 8.x
[app-scripts] This usually happens because your environment has changed since ru nning `npm install`.
[app-scripts] Run `npm rebuild node-sass --force` to build the binding for your current environment.
[app-scripts] at module.exports (D:\project-1\project-1\frontend\node_module s\node-sass\lib\binding.js:15:13)
[app-scripts] at Object.<anonymous> (D:\project-1\project-1\frontend\node_mo dules\node-sass\lib\index.js:14:35)
[app-scripts] at Module._compile (internal/modules/cjs/loader.js:689:30)
[app-scripts] at Object.Module._extensions..js (internal/modules/cjs/loader. js:700:10)
[app-scripts] at Module.load (internal/modules/cjs/loader.js:599:32)
[app-scripts] at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
[app-scripts] at Function.Module._load (internal/modules/cjs/loader.js:530:3 )
[app-scripts] at Module.require (internal/modules/cjs/loader.js:637:17)
[app-scripts] at require (internal/modules/cjs/helpers.js:20:18)
[app-scripts] at Object.<anonymous> (D:\project-1\project-1\frontend\node_mo dules\#ionic\app-scripts\dist\core\bundle-components.js:6:16)
[ERROR] A utility CLI has unexpectedly closed (exit code 1).
The Ionic CLI will exit. Please check any output above for error details
How can I solve this issue?

Delete the node modules and install again using npm install

It's fine now it was my node-sass just did this "npm uninstall node-sass" "npm install node-sass" "npm rebuild node-sass
use this
`npm rebuild node-sass`
if not done, then use this
`npm rebuild node-sass --force`

Related

Can't build Visual Studio Code source - "Error: Cannot find module 'gulp-bom'"

I am trying to build Visual Studio Code so the dependencies are compiled in (can't install rpm packages as I don't have root). I have worked through a few issues so far, but I can't figure out why I am getting the following error.
[mrhicks#xxxxxx repo]$ yarn run watch
yarn run v1.12.3
$ gulp watch --max_old_space_size=4095
[20:28:22] Node flags detected: --max_old_space_size=4095
[20:28:22] Respawned to PID: 27503
module.js:550
throw err;
^
Error: Cannot find module 'gulp-bom'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/users/mrhicks/projects/vscode/repo/build/lib/compilation.js:10:13)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I have make sure to re-run sudo npm install to try and ensure everything for npm is installed. I have been following the instructions from the VSCode site here
I had this locally. It went away after yarn add gulp-bom --no-save. 🤷‍♂️
If you applied the changes at https://github.com/addaleax/natives/commit/0abbec6b0e211c6bbe3bf0d2b33fcd68f5a6c980, you'll need to re-apply them after.

Error in installing Ionic

I'm a beginner for Ionic and getting mentioned error when i'm run the bellow code,
ionic start IonicShoppingList blank
Error: Cannot find module 'lodash._basecopy'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\Denuka\AppData\Roaming\npm\node_modules\ionic\node_modules\lodash._baseassign\index.js:9:16)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
I have installed node.js npm and ionic cordova.
What should i do to solve this ?
Be sure to install lodash in the required folder.
If that folder has a package.json file, it is also best to add --save behind the install command.
$ npm install lodash --save
if the package.json file exists, and if it contains the lodash dependency you could try to remove the node_modules folder and run following command:
$ npm cache clean
$ npm install
The first command will clean the npm cache. (just to be sure) The second command will install all (missing) dependencies of the project.
I hope it helps.

ionic Gulpfile (or dependent module) not found

I'm trying to open a project that i downloaded from github.the project uses ionic 2 but it returns this error :
[ERROR] Gulpfile (or dependent module) not found: .\gulpfile.js
For custom Gulpfile locations, you can run ionic config set gulp.file
<path>. Otherwise, the default Ionic Gulpfile can be downloaded from
https://github.com/ionic-team/ionic-app-base/blob/master/gulpfile.js
Or, if you don't use gulp, you can disable it by running ionic config
set gulp.enabled false.
Full error:
Error: Cannot find module 'ionic-gulp-sass-build'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (F:\ionic3\exemple
taxi\Ionic-2-Uber-master\gulpfile.js:31:17)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
i tried some solutions like :
1-Delete your node_modules folder
2-Remove gulp-sass from your package.json file
3-Remove node-sass from your package.json file (if you have it in there)
4-Run npm install gulp-sass --save-dev
Also this one :
1-update version-clean
2-the node_module and executenpm install
3-may be npm cache
But i still have the same error .Is it that i installed ionic3 and the project runs in ionic 2 the cause of the problem ?

Cannot find module ionic linux

I took a project from my friend (mac) and I put this project on my pc (linux) but it didn't work. I tried but nothing.
Error: Cannot find module '/home/nihed/Desktop/cleantoufoulakids3/node_modules/#ionic/app-scripts'
at Function.Module._resolveFilename (module.js:513:15)
at Function.Module._load (module.js:463:25)
at Module.require (module.js:556:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/#ionic/cli-utils/lib/ionic-angular/app-scripts.js:9:16)
at Generator.next (<anonymous>)
at /usr/local/lib/node_modules/ionic/node_modules/tslib/tslib.js:103:75
at new Promise (<anonymous>)
at Object.__awaiter (/usr/local/lib/node_modules/ionic/node_modules/tslib/tslib.js:99:16)
at Object.importAppScripts (/usr/local/lib/node_modules/ionic/node_modules/#ionic/cli-utils/lib/ionic-angular/app-scripts.js:7:20)
I think you should run npm install and ionic cordova prepare to install packages and plugins from the package.json.
Did you just copy node_modules directory too?

Bluemix Securegatway Installation Error on Windows Server 2012 R2

Installation goes through fine but we keep on getting this error message once launching the client's UI:
The command is: node lib\secgwclient.js cEm9COT0o411_prod_ng --1 INFO --P 9003 module.js:457
throw err;
Error: Cannot find module 'log4js'
at Function.Module.resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17) at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Program Files (x86)\Secure Gateway Client\ibm\securegateway\client\lib\utils\logging.js:26:18)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
The error is complaining about log4js module Cannot find log4js module. I tried manually installing the log4js modue using npm, but the error persists.
This issue usually indicates that the install is behind a firewall or proxy which caused the npm install to fail. Does the machine have outbound access to npmjs.com:443?
You can either re-install the client or run npm install from the client folder. If npm is not a globally recognized command, you will need to provide the path to npm that is packaged with the node version contained within the installation folder.