ionic cordova build ios
ng run app:ionic-cordova-build --platform=ios
Error: Unknown argument: platform
[ERROR] An error occurred while running subprocess ng.
ng run app:ionic-cordova-build --platform=ios exited with exit code 1.
Re-running this command with the --verbose flag may provide more
information.
It looks like you're running into permission issues. If you are installing npm-packages then it might possible that you are getting an EACCES error when trying to install a package globally. This means you do not have permission to write to the directories npm uses to store global packages and commands.
Try running commands:
sudo chmod u+x -R 775 ~/.npm
sudo chown $USER -R ~/.npm
or you can just run any npm command with sudo, that should get resolve your issue.
sudo ionic cordova build ios
I'd recommend you to take a look at https://docs.npmjs.com/getting-started/fixing-npm-permissions
I've setup a node project with husky but when my collegue tries to run npm install on his Mac he gets the following error :
noa-be#1.0.0 prepare
husky install
sh: husky: command not found
npm ERR! code 127
npm ERR! path /Users/X/Desktop/Workspace/project
npm ERR! command failed
npm ERR! command sh -c husky install
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/X/.npm/_logs/2021-04-12T13_07_25_842Z-debug.log
These are the relevant package.json parts:
{
"scripts": {
"prepare": "husky install"
},
"devDependencies": {
"husky": "^5.2.0",
}
}
I thought this would be enough for husky to be installed when running npm install, but it's not. What am I missing?
If you are using nvm, you might want to create a file called .huskyrc in your home directory and add the following lines of code to it:
~/.huskyrc
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
I was struggling with the same exact problem for hours. Finally, I could install dependencies and start working on my project by doing this:
Temporarily remove the "prepare": "husky install" script from the package.json file.
Run npm i (npm install). Dependencies installed successfuly.
Add again the "prepare" script that you removed in step 1.
Run again npm i to install the husky git hooks, so husky can do its job from now on.
This error is also thrown by npm ci if the NODE_ENV is set to "production" pre-install
I've been able to solve the problem by upgrading to latest Husky version (7.0.1, from 5.2.0).
Git was also helpful, and told me that the files weren't executables. (Git V 2.24.1)
So I give them executable rights :
chmod +x PATH_TO_HUSKY_FILE
You'll need to execute this command for every hooks
I believe it could be version specific issue. Install version 6, npm i husky#6.0.0 --save-dev, and it should work as the husky doc says.
Apparently, when I did npm i husky --save-dev, it was installing "husky": "^0.8.1" for me for some strange reason, giving me the exact same error: sh: husky: command not found.
Method 1:
Update manually, in your package.json:
{
"scripts": {
"prepare": "husky install",
"create-hook": "husky add .husky/pre-commit \"npm test\"",
}
}
Then, run npm run prepare && npm run create-hook.
It should create .husky directory with .pre-commit file in it.
Method 2:
npx husky install
npm set-script prepare "husky install"
npx husky add .husky/pre-commit "npm test"
It worked in my terminal but not in VSCode version control. So had to force quite the vscode app and restarting it worked.
Faced this issue in Github Desktop.
solved it by quit Github Desktop and re-open it.
I was able to fix this by providing an explicit location for husky
"scripts": {
"prepare": "node_modules/.bin/husky-run install"
},
Using Lerna
When I upgraded husky from version 4 to 8 there was information todo first pre commit manually. For this purpose pre-commit bash script was generated in .husky directory.
What I had todo was simply run the command included in this file:
lerna run precommit --concurrency 2 --stream
I try to run electron on may kali linux as where I am the root but it doesn't show anything but it works on my ubuntu where I am not the root.
When I run: npm run electron:start
I get this:
11640:0227/233443.028885:FATAL:atom_main_delegate.cc(211)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
help me please.
The only solution I found is to do it without being root. And until then for it to work when you execute the command "
npx cap open electron
", you must locate the directory of the chrome-sandbox file in the error message where you will have to execute the following two commands:
sudo chown root: root chrome-sandbox
sudo chmod 4755 chrome-sandbox
Generally, here is what I do to use ionic and electron on Kali linux:
1. npm install ngx-electron electron
2. npm install electron-packager --save-dev
3. ionic build
4. npx cap add electron
5. ionic build && npx cap copy
6. npx cap open electron
You can see here for more explanation:
https://gist.github.com/gnopor/d4813628c949294c4ef8b4ef88941f68
Please find exception for attached image.
I tried
Clear watchman watches: watchman watch-del-all.
Delete the node_modules folder: rm -rf node_modules && npm install.\n
Reset packager cache: rm -fr $TMPDIR/react-* or npm start -- --reset-cache.
But nothing seems to fix below issue. Please help me. Thanks in advance.
Full log here :
"Unable to resolve module SnapshotViewIOS from
/Users/dseerapu/Desktop/RDeal/DigitalMemberCard-FHNW/app/DigitalMemberCard/node_modules/react-native/Libraries/react-native/react-native-implementation.js:
Module does not exist in the module map\n\nThis might be related to
https://github.com/facebook/react-native/issues/4968\nTo resolve try
the following:\n 1. Clear watchman watches: watchman
watch-del-all.\n 2. Delete the node_modules folder: rm -rf
node_modules && npm install.\n 3. Reset packager cache: rm -fr
$TMPDIR/react-* or npm start -- --reset-cache."
Terminate the process in the terminal and then run npm start -- --reset-cache
npm install -g mean-cli works. but mean init says mean is not recognized as a internal command. How do I fix this?
I installed mean-cli from git, worked like a charm.
Open CMD
Run this: npm install -g git://github.com/djskinner/mean-cli.git
Hope this works for you too
It is possibly a NPM cache issue. Try running the following:
Update NPM
npm update -g npm
Then clear your NPM cache
npm cache clean
Once both commands have successfully ran, continue with the init
mean init <yourAppName>
For more reference material be sure to check out the docs at learn.mean.io.