NPM error while trying to make a auth system using Laravel Breeze - laravel

When I run npm install, I'm getting the following error:
How can I solve this?

Update your node.js to the latest
make sure that the node version is up to date by running:
$ node -v
in your CMD and by visiting
https://nodejs.org/en/download/current/
To know what is the latest version.
run this command in your CMD:
$ npm cache clean --force
then Delete node_modules by running:
$ rmdir /S /Q node_modules
or delete it manually by going into the directory and right-click > delete / move to trash. If you are not updating your packages you can delete the package-lock.json file too.
now you can run:
$ npm install
This works for me, all the best.

Related

How to uninstall Yarn from a project

I'm a bit confused.
I accidentally installed yarn in a project. I just ran the command yarn that installed the yarn in the project. How do I uninstall yarn from the project?
Do I type in npm uninstall yarn? to uninstall it from a project?
I looked at other solutions and I'm confused.
Run npm uninstall yarn make sure it no longer is listed in your package.json
Delete the yarn.lock file if there is one
If in linux (similar for others I guess):
cd project_directory
Run "npm uninstall yarn"
rm -rf .yarn
rm .yarnrc.yml
rm yarn.lock
in package.json: delete "yarn" lines
in .gitignore (if present): delete "yarn" lines
in README.md (if present): change "yarn" to "npm"
run "grep -irl yarn ." to find any other references

react-native init AwesomeProject gives an error EPERM: operation not permitted, chmod '/node_modules/#react-native-com...'

After installing brew, watchman and node. I tried to initiate my first react-native application from the terminal on a Mac machine.
When I run the command like it says on React Native Development site - React Native CLI Quickstart for macOS and iOS target.
npx react-native init AwesomeProject
I get the following error
EPERM: operation not permitted, chmod '/usr/local/lib/node_modules/react-native/node_modules/#react-native-community/cli/build/commands/server/external/xsel'
I am logged in as an admin, so that is not an issue, and I have even tried "sudo", but with no success.
Has anybody faced a similar issue?
Thanks in advance.
It seems that you are having a permission problem try to change the permissions to react-native's folder with your username.
sudo chown userName -R [PATH]
to know your username run this command in the terminal
whoami
or just do the following
close all VS Code instances.
clean cache with
npm cache clean --force
install the latest version of npm globally as admin:
npm install -g npm#latest --force
clean cache with
npm cache clean --force
Try to install your component once again.
you may want temporarily disable your antivirus program and try again.

"exp: command not found" How do I add expo cli to path?

I installed the expo cli with
npm i -g exp
then I run
exp
and I get
-bash: exp: command not found
I'm guessing I didn't add exp to path. So how do I do this properly? Nothing I've tried so far works.
This suggested 3 steps solution worked for me:
First check if ~/.npm-global/bin is in your path: echo $PATH. If it isn’t there, you will need to add it to the path.
Open up ~/.bash_profile then add the following line to the bottom: export PATH=$PATH:~/.npm-global/bin
Finally, back in the shell, type: source ~/.bash_profile
Hopefully that will have fixed your problem.
1. Find the path where expo is globally installed by npm:
npm bin -g
2. Add path from Step 1 to paths file:
sudo vi /etc/paths
3. Restart the Terminal
You should try npx expo init <your_app_name> to test.
It worked for me.
I also had a hard time getting expo command to work on Mac. Here are the steps I took to get it working.
npm root -g shows the directory the global modules are installed in:
/usr/local/Cellar/node/11.7.0/lib/node_modules
That directory might be different for you. After confirming expo is in there, edit ~/.bash_profile and add the line:
export PATH=$PATH:/usr/local/Cellar/node/11.7.0/bin
Save & exit, then run source ~/.bash_profile
Now the expo command should function as intended.
try sudo npm install --global expo-cli
this worked for me.
➜ MobileDev git:(campaigns-responsive) ✗ expo whoami
› Not logged in, run expo login to authenticate
➜ MobileDev git:(campaigns-responsive) ✗ expo init App
✔ Choose a template: › blank a minimal app as clean as an empty canvas
✔ Downloaded and extracted project files.
📦 Using npm to install packages.
✔ Installed JavaScript dependencies.
✅ Your project is ready!
To run your project, navigate to the directory and run one of the following npm commands.
- cd App
- npm start # you can open iOS, Android, or web from here, or run them directly with the commands below.
- npm run android
- npm run ios
- npm run web
exp was replaced with expo
To install Expo CLI, just run npm install -g expo-cli (or yarn global add expo-cli, whichever you prefer).
Following on this issue, I found I had multiple global folders so I started using a .npm-global folder as shown here: https://docs.npmjs.com/getting-started/fixing-npm-permissions
And now it's all clean and in control.
I had a similar issue.
-bash: expo: command not found
It turns out the command to install expo
npm install -g expo-cli was referencing an older version of node on my machine; when checked using npm root -g.
So I had to uninstall nvm/node, deleted any remnant folders & files of .nvm and shortcuts for nvm in /usr/local. Then reinstalled node and ran npm install -g expo-cli again.
That fixed my issue.
sudo npm install --unsafe-perm -g expo-cli
If you're using git bash on windows, add npm path to your system path variables. Generally located on this location:
C:\Users\<Username>\AppData\Roaming\npm
Then open the bash and command npm start. Hope this will help.
I solved it by putting this in my PATH environment variable / user variable:
C:\Users\{userName}\node_modules\.bin
yarn expo start
Worked for me.
npx create-expo-app project-name

Error: ENOENT: no such file or directory, scandir

I scaffold an app using jhipster which is microservice gateway using cassandra db and using maven to build which was building fine after scaffold.i ran gulp command to for the live reload of ui.
i made a change slighlty in navbar and home page of it.
which was also working file & made some changes in the json files of home & navbar & do some minor changes as adding the search box and other.
it failed to reload. I stop the gulp & maven & restarted them.
maven is building but again not loading the site in localhost
when i ran gulp it is showing me this error.
gulp
fs.js:952
return binding.readdir(pathModule._makeLong(path), options.encoding);
^
Error: ENOENT: no such file or directory, scandir '/home/hartron/foodnetteam/codebase/mandi/node_modules/node-sass/vendor'
at Error (native)
at Object.fs.readdirSync (fs.js:952:18)
at Object.getInstalledBinaries (/home/hartron/foodnetteam/codebase/mandi/node_modules/node-sass/lib/extensions.js:121:13)
at foundBinariesList (/home/hartron/foodnetteam/codebase/mandi/node_modules/node-sass/lib/errors.js:20:15)
at foundBinaries (/home/hartron/foodnetteam/codebase/mandi/node_modules/node-sass/lib/errors.js:15:5)
at Object.module.exports.missingBinary (/home/hartron/foodnetteam/codebase/mandi/node_modules/node-sass/lib/errors.js:45:5)
at module.exports (/home/hartron/foodnetteam/codebase/mandi/node_modules/node-sass/lib/binding.js:15:30)
at Object.<anonymous> (/home/hartron/foodnetteam/codebase/mandi/node_modules/node-sass/lib/index.js:14:35)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
Could anyone tell me solution for this
I sometimes also get this error when starting my gulp server. My workaround is to just run:
npm rebuild node-sass
And then gulp starts nicely afterward.
Here's what worked for me
$npm update
$npm install
$node node_modules/node-sass/scripts/install.js
$npm rebuild node-sass
For my case it helps only after doing this command:
node node_modules/node-sass/scripts/install.js
And then there will be /node_modules/node-sass/vendor folder
Some files may not be available in the local version of NodeJS, and sometimes NodeJS does not send a message about it. In this case --force is helpful.
npm install node-sass --force
or
npm rebuild node-sass --force
rebuild node-sass or just reinstall everything in case node-sass rebuild of doesn't work.
npm rebuild node-sass
or
rm -rf node_modules && npm install
or
npm rebuild
or
npm ci
or
just delete node_modules manually and package-lock.json and run npm i
The vendor directory is created during npm install. Try deleting your
node_modules and running npm install.
It is a problem with older version of node-sass. It doesn't create vendor folder in node_modules/node-sass. I have updated the version of node-sass and it worked fine for me.
My older version of node-sass was 3.1.0
I simply did:
npm install node-sass#3.7.0
This should solve your problem as well.
I just fixed this error. It was because I was trying to run the project from the wrong folder.
Make sure you have the config.json file. Then do the npm install and npm start.
This might give this error if you don't have this config file.
No need to delete node modules, its because of your sass-loader version is different
Delete package-lock.json
npm uninstall node-sass --save
npm i node-sass --save
delete the node-sass folder from node\npm-cache
npm rebuild node-sass
I did the below code,
sudo npm rebuild node-sass
mvn clean install
Update your gulp-sass in package.json with new version
"gulp-sass": "3.1.0" // 3.1.0 or later
This is the link which i follow https://github.com/dlmanning/gulp-sass/issues/508

Laravel elixir npm error Cannot find module 'laravel-elixir/ingredients/commands/Utilities'

I've came across this problem when I wanted to install a project from a couple of months ago onto my home-computer, i've installed my packages correctly, but when i try to run gulp, i constantly get this error:
Error: Cannot find module 'laravel-elixir/ingredients/commands/Utilities'
I've been debugging for about 5 hours now and i'm close to desperation :p , the solutions they offer online don't even seem appliable, they tell me to change a directory in the index.js of the laravel-elixir module, but the rules that need changing don't even exist in that file :p ,
Any help would mean the world to me!
As #Hkan proposed in the comments section:
Running the following commands will remove and reinstall all modules:
$ rm -rf node_modules/
$ npm install
$ gulp
Or as a one-liner:
$ rm -rf node_modules/ && npm install && gulp

Resources