in laravel homstead project npm install get error - node.js

My operating system is windows 10. I'm using laravel homestead (ubuntu 18.04) resent release and working in a virtual box with vagrant. After installing Laravel when I try to run:
composer require laravel/breeze --dev
to get the Authenticate part it works fine. after that, it says to run npm install && npm run dev
Then I CD to my test.com project and ran that command
after install, some features below error appears.
(I get the same issue when I try to require jetstream )
I used my Git bash shell as admin. I did re-run npm, npm clear cash force, remove package.json but still having the same problem.
sudo npm install says some permission problem in the host computer.
Actually, I'm Stuck. Please help
npm ERR! code ENOENT<br>
npm ERR! syscall open<br>
npm ERR! path /home/vagrant/code/test.com/node_modules/yargs/node_modules/yargs-parser/
package.json.1050278784
npm ERR! errno -2<br>
npm ERR! enoent ENOENT: no such file or directory, open '/home/vagrant/code/test.com/no
de_modules/yargs/node_modules/yargs-parser/package.json.1050278784'<br>
npm ERR! enoent This is related to npm not being able to find a file.<br>
npm ERR! enoent<br>
npm ERR! A complete log of this run can be found in:<br>
npm ERR! /home/vagrant/.npm/_logs/2020-12-20T04_04_37_652Z-debug.log<br>
vagrant#homestead:~/code/test.com$ cd /

Related

npx start, npx install npx init is not working

I have been working with react for years using NPX and yarn and I just got assign to built an app with react-native using react native-cli so i tried setting up my environment using the react native docs and some YouTube videos. But after following the instructions like downloading android studios and adding in my new environment variable, I'm getting an error every time i tired to run
"npx react-native init AwesomeProject" which gave me this error
[![npx react-native init result][1]][1]
I also tried npm install and i got this error on git bash and also on my commandline
npm ERR! syscall spawn bash
npm ERR! path C:\Users\Dennis\Desktop\GitHub\LCRN01-travel-onboarding-app-master\LCRN01-travel-onboarding-app-master\node_modules\core-js
npm ERR! errno -4058
npm ERR! enoent spawn bash ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Dennis\AppData\Local\npm-cache\_logs\2021-11-13T05_50_35_592Z-debug.log```
and also npx react-native start is showing this error on git bash
```openssl config failed: error:02001003:system library:fopen:No such process
Command `start` unrecognized. Make sure that you have run `npm install` and that you are inside a react-native project.```
I have tried running "npm cache clean --force"
but still nothing changed
I can't even run npx create-react-app anymore because i keep getting this error
npx creat-react-app test
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/creat-react-app - Not found
npm ERR! 404
npm ERR! 404 'creat-react-app#latest' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Dennis\AppData\Local\npm-cache_logs\2021-11-13T06_05_46_068Z-debug.log
I'm currently using a windows 10 device
node -v 16.13.0
npm -v 8.1.3
[1]: https://i.stack.imgur.com/OTLYj.png
It's create-react-app.
Not totally sure but another issue could be that your Git bash isn't in your PATH.
Plus, npx start and npx install doesn't sound right, maybe you meant npm start and npm install.
On top of that, it seems you have node v11 and not node v16, maybe you have different versions of node, some in Windows' PATH and some only accessible from bash.
It could help to clean up and reinstall your node versions and Git bash, also check your environment variables for remnants of previous versions, and make sure to not confuse npm and npx.

NPM not working on Virtualbox shared folder under Ubuntu on a Windows 10 host

I'm trying to set-up a development environment on a Virtualbox machine using Vagrant. I'm using Windows 10 as a host machine, and ubuntu/bionic64 as a guest machine.
My package.json file is located under a shared directory between the host machine and the guest machine. However whenever I run npm install --no-bin-links I do get the following error:
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/vagrant/www/wp-content/plugins/my-plugin/node_modules/array-initial/node_modules/is-number/package.json.1640612897
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/vagrant/www/wp-content/plugins/my-plugin/node_modules/array-initial/node_modules/is-number
/package.json.1640612897'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2021-01-19T05_31_47_272Z-debug.log
Inside the guest machine, if I copy the package.json and package-lock.json into another directory that is not shared, and then run npm install everything works perfectly.
mkdir /tmp/test/
cp package.json package-lock.json /tmp/test/
cd /tmp/test/ && npm install
# NPM Packages are installed successfully!
I think this error is specific to Windows, as I've been a user of Ubuntu for years, and never had a similar issue. I only started using Windows a week ago.
The strange thing is, I also have another development environment on the same machine, and NPM works just fine, without any issues on shared folders!
I used the --no-bin-links, so I don't think the issue has anything to do with the symbolic links.
Looking into the strace output, I can't see when this file node_modules/array-initial/node_modules/is-number /package.json.1640612897 was created.
NPM log
Strace log

Error to install PM2 globally on Ubuntu Server 20.04LTS

I have a VM running Ubuntu Server 20.04LTS and I want to run a nodejs program using PM2. I'm having problems to install pm2 npm install -g pm2#latest and sudo npm install -g pm2#latest.
npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /usr/lib/node_modules/pm2/node_modules/mocha/node_modules/mkdirp/bin/cmd.js
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/lib/node_modules/pm2/node_modules/mocha/node_modules/mkdirp/bin/cmd.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-06-04T18_01_48_656Z-debug.log
Ps: I tried npm install -g npm#latest and cleaning npm cache but nothing seems to work. The error says that this file doesn't exist but despite knowing that, I don't know what I can do or what is causing the problem. I don't know if this affects something but I'm on root mode
The author of pm2-web deprecated it a while ago, so it might be uninstallable any more.
from the official github readme:
Since it's no longer possible to monitor pm2 running on multiple
machines I'm not really working on pm2-web any more.
For an alternative, check out Guvnor - a process manager with support
for multiple hosts, unix based permissions, a far more capable web
interface and more.
Guvnor too wasn't easily installable on ubuntu 20.04, right now I use pm2.io or pm2-gui to control my instances via web interface.

I cannot create angular project with "ng new app_name". Get error -4058

When I execute the command ng new app-name I get error -4058.
When I run the same command opening cmd as administrator in the directory C: / Windows/system32 I have no problems when creating the project. But if I change the directory I have the same issue.
I suppose it must be a permissions problem but it is not solved by opening cmd as administrator.
The creation process is frozen in extract: rxjs: and after a long time I get the following error
npm ERR! path C:\Users\Usuario\proyectName\node_modules\#angular-devkit\build-optimizer\node_modules\typescript
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Usuario\proyectName\node_modules\#angular-devkit\build-optimizer\node_modules\typescript' -> 'C:\Users\Usuario\proyectName\node_modules\#angular-devkit\build-optimizer\node_modules.typescript.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Usuario\AppData\Roaming\npm-cache_logs\2018-03-20T02_40_45_377Z-debug.log
Error: Package install failed, see above.
Package install failed, see above.
Npm version
5.7.1
Angular version
Angular CLI: 1.7.3
Node: 8.10.0
OS: win32 x64
Angular:
...
I was able to solve the problem by uninstalling completely angular/cli and node
Uninstalling angular/cli and nodejs as administrator.
Delete folders from% appdata% (npm, npm-cache)
delete "nodejs" folder from Programs and Files
Reboot
Reintall lastest version node (not as administrator)
Install angular/cli (not as administrator)

"Permission Denied" in Node on Linux, when running start-script /w local nodemon/mocha/babel-node

I'm having issues with my new linux setup - I've installed nodemon as a local dependency (NOT globally) and I'm trying to execute it from my package.json "start"-script. I'm getting this permission error.
node by itself works great, but as soon as I try to use babel-node or nodemon or even mocha, I get permission problems.
My setup is divided across 2 hard drives - node is installed on my SSD (with my OS), and my project (and it's node_modules, where I'm trying to execute nodemon from is on my storage-HDD.
sh: 1: nodemon: Permission denied
npm ERR! Linux 3.19.0-56-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v5.9.0
npm ERR! npm v3.7.3
npm ERR! code ELIFECYCLE
npm ERR! vyggo-easyrtc#1.0.0 start: `nodemon --exec node entry`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the vyggo-easyrtc#1.0.0 start script 'nodemon --exec node entry'.
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 vyggo-easyrtc package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! nodemon --exec node entry
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs vyggo-easyrtc
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls vyggo-easyrtc
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /media/goatic/HDD/Projects/Node/vyggo-easyrtc/npm-debug.log
goatic#goatic-laptop:/media/goatic/HDD/Projects/Node/vyggo-easyrtc$
I had this problem after changing moving my project from an NTFS filesystem to linux. I changed all the file/directory permissions to 644/755 and also set the owner/group. That's when I started getting this error.
When I tried nodemon in the terminal, I got command not found. Strange.
Reinstalling nodemon fixed it:
sudo npm install -g nodemon
My secondary drive was incompatible with my linux OS in terms of permissions, as it was an NTFS partition.
I ended up moving everything to my primary drive, and of course permissions were working again, allowing me to execute local dependencies.
I guess the solution to my problem, had I relied on keeping projects on the secondary drive, would be to format it to a format compatible with Linux permissions.
If you are installing in MAC Use.
sudo npm install -g nodemon --unsafe-perm.
It will work.
I had the same problem. In my case when I changed my operating system to Linux Ubuntu, 20.04.1 Version, reinstalling nodemon solved the problem.
For Linux users:
sudo npm install -g nodemon
for Windows users, open a new terminal or cmd prompt just write:
npm install -g nodemon
For more information check nodemon documentation:
nodemon documentation
I counter this problem when I git clone a project which initially created on a Windows machine, my simple solution is to delete the .node_modules directory and then run npm install, which solved my problem.
very weird, I had the same problem except I solved it by replacing Nodemon devStart with nodemon devStart and suddenly the error was gone :)

Resources