Laravel development on Windows 10 - node is not recognized - node.js

Here is my problem, I am dealing with it for a days, and any help is greatly appreciated.
I am developing a project using Laravel, on a Windows 10. I have installed NodeJS, NPM works just as expected, and also when I check node -v through CMD or PowerShell it shows current version.
So, my environment variables are placed where it should be, and works properly.
But the problem is, whenever I try to use some package in Laravel that relies on node, it shows me "node is not recognized..." Examples that occur this problem are spatie/browsershot, rialto-php/puphpeteer, and many other that relies on puphpeteer or on node generally.
Once again, my environment variables are set, but maybe they are not provided to Laravel or something like that?
Any ideas about this..
Thanks in advance!

Related

Beginner Working Through Authentication (Node.js example)

Currently working through some of the documentation examples from Jack Henry and I've ran into an issue on the Authentication (Node.js) example project (https://jackhenry.dev/open-api-docs/consumer-api/quickstarts/authentication/)
For reference, here is the git repository being used https://github.com/Banno/consumer-api-openid-connect-example
I have Node.js/npm installed locally and after using "npm install", when I try to use "npm start", I get an error. Screenshot of Error
> #banno/consumer-api-openid-connect-example#1.0.0 start
> ENVIRONMENT='local' node server.js
>'ENVIRONMENT' is not recognized as an internal or external command,
>operable program or batch file.
I've not modified any of the package.json file where this line is located, which is throwing the error.
Any suggestions as to what could be the issue? Thanks!
The Node.js examples more or less assume a *nix-compatible operating environment (e.g. Linux, Unix, macOS) and apparently do not work on vanilla Windows.
The suggestions above from other folks for working around how to set up the command line variable or using cross-env might be good to try.
It might also be worth considering using Windows Subsystem for Linux to get that *nix-compatible operating environment.
It looks like Microsoft has some documentation on how to Install Node.js on Windows Subsystem for Linux (WSL2).

Node cannot run serverless cmd

I tried updating both Serverless module and Node, but still receives the same error.
I count not even find the solution in the internet for this simple problem.
can someone suggest.
The issue for me was that I was missing the following directory in my Windows PATH env variable:
%AppData%\npm
Once I added that I could run serverless, SLS, etc.
Don't forget the restart your PC.

React start up problem with new react app windows [solved]

Hello i am not really sure how to explain my problem or how to ask for help.
But am going to try it anyway lately when i create a react app it installs like normal.
But from the moment i use npm start i get this error (npm start error terminal).
Which says it has nothing wrong with node js/npm so i suspected it was something about the react app dependency that was wrong. When i downgrade to a older version of react scripts it works but the newest version 16.13.1 doesn't work even tho i use this version of react on my windows laptop. In case it helps to solve my issue here is the error log that npm generates (error log npm) i hope this helps to solve my issue
I have found the solution for my problem by setting the path value for system32.
You can do this by the following steps
Goto > Control Panel\System and Security\System\Advance system setting\Enviroment variable and set system variables path C:\Windows\System32\ variable and restart your System.
After i have done these steps it seems to work

Why does PM2 work on one server, but not on another?

We have two instances of our Node-Express app: one for development, and one for production. We are implementing PM2 process manager. This is for a Windows Server 2012 environment.
For some baffling reason, PM2 (with pm2-windows-service) worked fine when set up in our dev environment, but won't even run node in our Prod environment. What could be the cause?
Log files reveal nothing helpful
If you look at my related question, you can see that PM2 appears to be launching node, but is not (or it instantly crashes).
All we can conclude is there is some difference in settings between these two servers. Any clue what difference in settings might be causing PM2 to fail like this?
This is related to a more specific question I have out there about issues we're having implementing PM2.
Thank you!
Ok, I got the answer after posting an issue to the pm2 github issues page.
Sharing it here in case anyone else finds themselves in this situation:
https://github.com/Unitech/pm2/issues/4113
(basically pm2 3.2.5 introduced a bug that causes this issue in Windows. My QA install was 3.2.4. The issue was resolved by reverting to 3.2.4. Simple process, see instructions at link above.)
It may be not really pm2 issue, bit more npm. On the server where pm2 doesn't work please try that command in PowerShell:
Get-Command pm2
Does it return the correct version(not 0.0.0)? If not, there is an issue diring installing that package, so as an option it's possible to install that manually. Also we asked familiar question in that ticket last month:
https://github.com/Unitech/pm2/issues/3964
Like it described in a ticket above you can try to check other npm package with familiar issues:
npm install mocha -g
And that try to reach mocha-cli

Issues running React app on Windows environement

I have a working react app that I had hosted on a linux environment, but the client has switched their hosting provider and now I have to run the app on a Windows environment. I personally am unfamiliar with Windows and having some serious issues getting my app to work now.
After loads of debugging and testing I now can get my app to run, but when I start it, it will throw some errors which will results in a broken app in the browser.
So when I run npm start it will start up the app and spit out this error:
Screenshot of the terminal error 1/2
Screenshot of the terminal error 2/2
It seems to spit out some complaints when using npm run watchJS which runs this command babel src --watch --out-dir lib.
I am completely lost at this point and have no idea where to go from here.
I can provide as much detail as anyone needs after looking at the question, I just don't know what else to add to this issue and don't want to fill up this question with irrelevant info.
Thanks in advance for any help
It is likely a bug with the version of npm you are using.
See this thread:
https://github.com/npm/npm/issues/18380
Try rolling back your version of npm to 5.3
The issue appears to be exclusive to windows with babel packages.

Resources