I'm following this realm tutorial and having trouble with realm-cli installation. I'm running
sudo npm install -g mongodb-realm-cli ,
which gives me the following error:
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
/usr/local/bin/realm-cli -> /usr/local/lib/node_modules/mongodb-realm-cli/wrapper.js
> mongodb-realm-cli#2.1.0 install /usr/local/lib/node_modules/mongodb-realm-cli
> node install.js
downloading "realm-cli" from "https://s3.amazonaws.com/realm-clis/realm_cli_rhel70_97239c6794575bad1486a178501366cea7e7d399_21_08_16_19_49_31/macos-amd64/realm-cli"
failed to download Realm CLI: Error: EACCES: permission denied, open '/usr/local/lib/node_modules/mongodb-realm-cli/realm-cli'
at Object.openSync (fs.js:498:3)
at /usr/local/lib/node_modules/mongodb-realm-cli/install.js:62:24
at new Promise (<anonymous>)
at requstBinary (/usr/local/lib/node_modules/mongodb-realm-cli/install.js:56:10)
at Object.<anonymous> (/usr/local/lib/node_modules/mongodb-realm-cli/install.js:101:1)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
errno: -13,
syscall: 'open',
code: 'EACCES',
path: '/usr/local/lib/node_modules/mongodb-realm-cli/realm-cli'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mongodb-realm-cli#2.1.0 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mongodb-realm-cli#2.1.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
This is what I have so far:
node -v: 14.17.6,
npm -v: 6.14.15
P.S.: it works fine on Windows 10.
Thanks in advance!
Related
I'm trying to deploy an app to heroku but for some reason when I run the deploy command I keep on getting this error:
rator-cli\postgrator-cli.js:143
rl.history = rl.history.slice(1);
^
TypeError: Cannot read property 'slice' of undefined
at C:\Users\Zackr\Documents\node\noteful-exercise\noteful-server\node_modules\postgrator-cli\postgrator-cli.js:143:33
at Interface._onLine (readline.js:327:5)
at Interface._normalWrite (readline.js:474:12)
at Socket.ondata (readline.js:186:10)
at Socket.emit (events.js:315:20)
at addChunk (_stream_readable.js:295:12)
at readableAddChunk (_stream_readable.js:271:9)
at Socket.Readable.push (_stream_readable.js:212:10)
at Pipe.onStreamRead (internal/stream_base_commons.js:186:23)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! noteful-server#1.0.0 migrate: `postgrator --config postgrator-config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the noteful-server#1.0.0 migrate 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\Zackr\AppData\Roaming\npm-cache\_logs\2021-01-04T22_04_36_447Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! noteful-server#1.0.0 migrate:production: `env SSL=true DATABASE_URL=$postgres://rwdhntkhuroptu:48522106b9f5aaf0890905df7abe67c75710e00aba50b80edcf01a07d5cbe918#ec2-52-203-49-58.compute-1.amazonaws.com:5432/dcgq78oje0lmb6 npm run migrate`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the noteful-server#1.0.0 migrate:production 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\Zackr\AppData\Roaming\npm-cache\_logs\2021-01-04T22_04_36_547Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! noteful-server#1.0.0 postdeploy: `npm run migrate:production`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the noteful-server#1.0.0 postdeploy 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\Zackr\AppData\Roaming\npm-cache\_logs\2021-01-04T22_04_36_614Z-debug.log
The scripts for my package.json is:
"scripts": {
"test": "mocha --require test/setup.js",
"dev": "nodemon src/server.js",
"migrate": "postgrator --config postgrator-config.js",
"migrate:test": "env NODE_ENV=test npm run migrate",
"migrate:production": "env SSL=true DATABASE_URL=$(heroku config:get DATABASE_URL) npm run migrate",
"start": "node src/server.js",
"predeploy": "npm audit && npm run migrate:production",
"deploy": "git push heroku main"
},
I have the connection string and url for the database and the normal migration worked until I changed the url to the heroku URL instead of my local host server.
Node.js 6 was end-of-lifed in April 2018. It has known security vulnerabilities and most libraries don't support it. Update to at least Node.js 10.x, and preferably 14.x.
Current version of postgrator-cli is 4.0.0 and it explicitly doesn't support Node.js prior to 10.x. The last version of postgrator-cli to support Node.js 6.x was postgrator-cli 3.2.0, published in September 2019. So if you cannot upgrade Node.js, another option is to downgrade postgrator-cli to 3.2.0.
I am using mac
I tried to run my first ionic project , But I am facing erroe in running it in my mac
I am putting all the steps that I have followed into Terminal -
Started with - : $ ionic start MyIonicProject tutorial
$cd MyIonicProject
$ionic serve
then I am getting error
Error: EACCES: permission denied, open '/Users/user/.ionic/helper.log'
> ionic-app-scripts serve --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser
[INFO] Looks like #ionic/app-scripts isn't installed in this project.
This package is required for this command to work properly.
? Install #ionic/app-scripts? Yes
> npm i -D -E #ionic/app-scripts
npm WARN deprecated hoek#2.16.3: The major version is no longer supported. Please update to 4.x or newer
npm WARN checkPermissions Missing write access to /Users/user/Projects/MyIonicProject/node_modules
npm WARN checkPermissions Missing write access to /Users/user/Projects/MyIonicProject/node_modules/#ionic
npm ERR! path /Users/user/Projects/MyIonicProject/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/Users/user/Projects/MyIonicProject/node_modules'
npm ERR! { Error: EACCES: permission denied, access '/Users/user/Projects/MyIonicProject/node_modules'
npm ERR! stack: 'Error: EACCES: permission denied, access \'/Users/user/Projects/MyIonicProject/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/Users/user/Projects/MyIonicProject/node_modules' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/user/.npm/_logs/2018-09-21T06_24_56_379Z-debug.log
users-MacBook-Pro-3:MyIonicProject user$
Try running command by appending sudo as follows:
sudo ionic serve
Or
run below command in the terminal window:
sudo chown -R $USER /usr/local/
This will change the permissions of every thing inside the local folder and then try below command:
sudo ionic serve
Looks like #ionic/app-scripts isn't installed in this project.
So try first this :
npm install #ionic/app-scripts#latest --save-dev
Then:
npm install
and
ionic serve -l
I am trying to install ionic plugin add cordova-plugin-camera
and getting following error in windows system-
Ionic cordova -plugin installation error
Error: Failed to fetch plugin cordova-plugin-camera via registry. Probably this is either a connection problem, or plugin spec is incorrect. Check your connection and plugin name/version/URL. Error: cmd: Command failed with exit code 4294963248 Error output: node-pre-gyp ERR! UNCAUGHT EXCEPTION node-pre-gyp ERR! stack Error: Cannot find module 'internal/fs' node-pre-gyp ERR! stack at Function.Module._resolveFilename (module.js:470:15) node-pre-gyp ERR! stack at Function.Module._load (module.js:418:25) node-pre-gyp ERR! stack at Module.require (module.js:498:17) node-pre-gyp ERR! stack at require (internal/module.js:20:19) node-pre-gyp ERR! stack at evalmachine.<anonymous>:18:20 node-pre-gyp ERR! stack at Object.<anonymous> (D:\Ionic Demo\Social-Media\node_modules\thread-sleep\node_modules\node-pre-gyp\nod e_modules\tar\node_modules\fstream\node_modules\graceful-fs\fs.js:11:1) node-pre-gyp ERR! stack at Module._compile (module.js:571:32) node-pre-gyp ERR! stack at Object.Module._extensions..js (module.js:580:10) node-pre-gyp ERR! stack at Module.load (module.js:488:32) node-pre-gyp ERR! stack at tryModuleLoad (module.js:447:12) node-pre-gyp ERR! System Windows_NT 6.1.7601 node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\Ionic Demo\\Social-Media\\node_modules\\thread-sleep\\node_modul es\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd D:\Ionic Demo\Social-Media\node_modules\thread-sleep node-pre-gyp ERR! node -v v7.5.0 node-pre-gyp ERR! node-pre-gyp -v v0.6.9 node-pre-gyp ERR! This is a bug in `node-pre-gyp`. node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help: node-pre-gyp ERR! <https://github.com/mapbox/node-pre-gyp/issues> 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 optional SKIPPING OPTIONAL DEPENDENCY: thread-sleep#1.0.4 (node_modules\thread-sleep): npm WARN optional SKIPPING OPTIONAL DEPENDENCY: thread-sleep#1.0.4 install: `node-pre-gyp install --fallback-to-build` npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 7 npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "cordov a-plugin-camera" "--save" npm ERR! node v7.5.0 npm ERR! npm v4.1.2 npm ERR! path D:\Ionic Demo\Social-Media\node_modules\thread-sleep\node_modules\node-pre-gyp\node_modules\nopt\node_modules npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall scandir npm ERR! Error: EPERM: operation not permitted, scandir 'D:\Ionic Demo\Social-Media\node_modules\thread-sleep\node_modules\node-pre-g yp\node_modules\nopt\node_modules' npm ERR! { Error: EPERM: operation not permitted, scandir 'D:\Ionic Demo\Social-Media\node_modules\thread-sleep\node_modules\node-pr e-gyp\node_modules\nopt\node_modules' npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'scandir', npm ERR! path: 'D:\\Ionic Demo\\Social-Media\\node_modules\\thread-sleep\\node_modules\\node-pre-gyp\\node_modules\\nopt\\node_modu les' } npm ERR! npm ERR! Please try running this command again as root/Administrator. npm ERR! Please include the following file with any support request: npm ERR! D:\Ionic Demo\Social-Media\node_modules\npm-debug.log
Any help in this would be appreciable,thanks
I solved this reinstalling the plugin for backwards compatible with previous versions of Cordova cordova-plugin-compat.
You have to follow this steps:
cordova plugin remove --force cordova-plugin-compat
cordova plugin add cordova-plugin-compat
cordova plugin add cordova-plugin-camera
I have had considerable trouble trying to install Ionic on my Mac. I have tried every suggestion posted on the web without success. I have tried installing as root, using sudo, you name it.
Using Homebrew I have successfully installed node : v6.10.0 and npm v4.1.2.
Issuing: "npm install -g cordova ionic"
Results in:
npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cordova" "ionic"
npm ERR! node v6.10.0
npm ERR! npm v4.1.2
npm ERR! path /Users/craigmaxey/.npm
npm ERR! code EPERM
npm ERR! errno -1
npm ERR! syscall mkdir
npm ERR! Error: EPERM: operation not permitted, mkdir '/Users/craigmaxey/.npm'
npm ERR! at Error (native)
npm ERR! { Error: EPERM: operation not permitted, mkdir '/Users/craigmaxey/.npm'
npm ERR! at Error (native)
npm ERR! errno: -1,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/Users/craigmaxey/.npm' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cordova" "ionic"
npm ERR! node v6.10.0
npm ERR! npm v4.1.2
npm ERR! path npm-debug.log.3262676290
npm ERR! code EPERM
npm ERR! errno -1
npm ERR! syscall open
npm ERR! Error: EPERM: operation not permitted, open 'npm-debug.log.3262676290'
npm ERR! at Error (native)
npm ERR! { Error: EPERM: operation not permitted, open 'npm-debug.log.3262676290'
npm ERR! at Error (native)
npm ERR! errno: -1,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'npm-debug.log.3262676290' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/craigmaxey/npm-debug.log
This:
EPERM: operation not permitted, mkdir '/Users/craigmaxey/.npm'
indicates that you're missing write privileges on /Users/craigmaxey/.npm. Usually, you can fix this by running npm with sudo:
sudo npm install -g cordova ionic
If this doesn't work for you (since you mentioned you already tried sudo), please add the exact error message you get from running this exact command.
I too was getting the same errors and was able to get it to install following these steps:
Using Finder, manually create a folder called "#ionic" at this location: /usr/local/lib/node_modules/#ionic
Using finder, if "ionic" folder exists at /usr/local/bin/ionic, delete it
run sudo npm install -g #ionic/cli
I build an hybrid app using Ionic 2.
I got a windows pc and using mac virtual box for Xcode.
I can run the app on browser and android just fine in my windows.
problem is when I'm moving to mac I'm doing the same things on node JS and I get errors.
I used those lines in the terminal
ionic start/run/emulate/build Vme2
sudo ionic start/run/emulate/build Vme2
none works
this is the error I get
> ionic-hello-world# build /Users/amitaimazliah/Desktop/Vme2
> ionic-app-scripts build
[08:38:07] ionic-app-scripts 0.0.38
[08:38:07] build prod started ...
[08:38:07] clean started ...
[08:38:07] clean finished in 3 ms
[08:38:07] copy started ...
[08:38:07] ngc started ...
[08:38:07] copy finished in 262 ms
[08:38:07] build prod failed: spawn EACCES
[08:38:07] ionic-app-script task: "build"
[08:38:07] Error: spawn EACCES
npm ERR! Darwin 14.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! ionic-hello-world# build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ionic-hello-world# build script 'ionic-app-scripts build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ionic-hello-world package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ionic-app-scripts build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ionic-hello-world
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ionic-hello-world
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/amitaimazliah/Desktop/Vme2/npm-debug.log
Caught exception:
undefined
Mind letting us know? https://github.com/driftyco/ionic-cli/issues
[08:38:07] lint started ...
[08:38:08] tslint: src/pages/home/home.ts, line: 57
Unused method: 'setNewPhotos'
L57: private setNewPhotos()
[08:38:08] lint finished in 1.27 s
(node:2376) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: channel closed
any ideas what am I doing wrong?
thanks
You have problem when build app.Can you try use this command '
ionic hooks add
Cheer !