Tonight I decided I'd try to build a simple Node.js application using Express on my Windows 7 machine. The installation went fairly smoothly, but Express refuses to cooperate. Here are the steps I've taken:
Installed Node.js using the MSI available at http://nodejs.org/dist/v0.6.9/node-v0.6.9.msi
Installed Express by running npm install express g from a command prompt.
Created a directory for the application c:\source\node> mkdir newapp.
Changed directory to the application directory c:\source\node> cd newapp.
Ran Express: c:\source\node\newapp> express --sessions --css stylus.
At this point the node.exe process fires up and runs endlessly at 25% CPU Time and continually uses more memory. After running for 20+ minutes the node.exe process uses 300+ MB of Memory. The express command never completes and the newapp directory remains unaltered.
If I run express --help I see the help output in the console. I've tried running the command prompt as and Administrator but still Express appears to hang.
Does anyone have a clue what's going on or what I'm doing wrong? Thanks in advance!
This is a bug in the Windows version of Node v0.6.9. Filesystem access is pretty much messed up. Rollback to v0.6.8 http://nodejs.org/dist/v0.6.8/node-v0.6.8.msi and you should be fine.
The Express.js command line on Windows doesn't quite work well either. I just tried with Node v0.6.8.
This works
express --sessions myapp
This doesn't work for me
express --sessions --css stylus myapp
Fortunately you can add stylus support manually in your generated app. Open up app.js and in the app.configure function, add:
app.use(require('stylus').middleware({src: __dirname + '/public'}));
Hope this helps!
Update:
Oh ya, don't forget your NPM commands. In your app directory, you may need to npm install jade and npm install stylus.
Related
I've been working with AWS lambdas for a few months. I was working with a lambda and it was fine at the end of the day. I came back to work on it the next day, and I can't get Visual Studio to even start the application using the Mock Lambda Test Tool.
I ended up creating an empty lambda that just returns the input (the standard project code that AWS gives you as a template) and that won't even run. I hit the play button to star the Mock Lambda Test Tool, it looks like it will run for a couple seconds, then it closes down. The command window does not even pop up.
This is the code from the template project.
public string FunctionHandler(string input, ILambdaContext context)
{
return input?.ToUpper();
}
This is all I get in the output window of VS:
The target process exited without raising a CoreCLR started event.
Ensure that the target process is configured to use .NET Core. This
may be expected if the target process did not run on .NET Core. The
program '[16700] dotnet-lambda-test-tool-2.1.exe: Program Trace' has
exited with code 0 (0x0). The program '[16700]
dotnet-lambda-test-tool-2.1.exe' has exited with code -2147450726
(0x8000809a).
I have tried re-installing the AWS toolkit, and also tried re-installing Visual Studio. This is an issue with VS 2017 and VS 2019. I just installed 2019 to see if that would fix the issue. Any help would be appreciated.
I came to this question having the very same issue. After installing AWS Toolkit I found that the lambda test tool was not installed and therefore I got the same error just as the OP. The only difference is that I was targeting .Net Core 3.1 and therefore I needed amazon.lambda.testool-3.1. However this answer should work for both scenarios.
Unfortunately I did not have the same luck as the OP of having a nice co-worker that could give me the files I needed. So, if this is also your case please continue reading.
In the official project site, which can be found here, there are the instructions to install the tools. It also says that installing the latest version of AWS Toolkit should be enough to have the tools installed (it was not in my case and probably in yours).
It says that in order to install the tools you should run the following commands:
dotnet tool install -g Amazon.Lambda.TestTool-3.1
or
dotnet tool install -g Amazon.Lambda.TestTool-2.1
depending on which tool you need.
However, running these commands fails with the following message:
The tool package could not be restored.
Tool 'amazon.lambda.testtool-2.1' failed to install. This failure may have been caused by:
* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET Core tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.
For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool
And since the project is still in preview I just had to find the latest stable version in order to specify it in the command. For .net core 3.1 here is the nuget site, there I found version 0.10 to be the latest, so the command should look like:
dotnet tool install -g --version 0.10 Amazon.Lambda.TestTool-3.1
I have faced the same issue and when i tried to install dotnet-lambda-test-tool-3.1.exe using command prompt I got this issue:
Failed to create shell shim for tool 'amazon.lambda.testtool-3.1': Command 'dotnet-lambda-test-tool-3.1' conflicts with an existing command from another tool.
Tool 'amazon.lambda.testtool-3.1' failed to install.
And I did the following to fix issue
Deleted the dotnet-lamda-test-tool-3.1.exe from the installed folder (C:\Users%USERNAME%.dotnet\tools\dotnet-lambda-test-tool-3.1.exe)
Run dotnet tool install -g --version 0.10 Amazon.Lambda.TestTool-3.1 on cmd.
I have faced the same issue and got errors like "dotnet-lamda-test-tool-2.1.exe has exited with code.."
I did the following to fix the issue
Removed the dotnet-lamda-test-tool-2.1.exe from the installed folder
(C:\Users%USERNAME%.dotnet\tools\dotnet-lambda-test-tool-2.1.exe)
Removed the [amazon.lambda.testtool-2.1] folder as well
(C:\Users%USERNAME%.dotnet\tools\tools.store\amazon.lambda.testtool-2.1)
Installed dotnet tool from Developer command prompt using the command
[install -g Amazon.Lambda.TestTool-2.1]
Run the project. It is working
I have seen this issue many time on my system with dotnet-lambda-test-tool-6.0. Only one fix work for me
Remove dotnet-lambda-test-tool-6.0.exe from C:\Users\username.dotnet\tools
Open Command prompt from C:\Users\username.dotnet\tools
run command dotnet tool install -g Amazon.Lambda.TestTool-6.0
For anyone else that hits this same issue, it had to do with the the AWS toolkit install. I did not modify it, but somehow it was no longer working. I tried un-installing and re-installing, but it was still having issues running it. A co-worker sent me the exe and subdirectory that was setup on his machine under C:\Users\%user%.dotnet\tools. The exe is located in this directory, and there is another folder under .store for amazon.lambda.testtool-2.1. That directory had different folders and files than what I was able to install. So I copied in what he had and it worked. There might be a profile file associated to the tools install that points to these folders and files that might need to be modified. Since I was able to fix it with this, I didnt look any further into that.
I had the same issue with my .NET 6.0 lambda project. I installed the tool by executing dotnet tool install --global Amazon.Lambda.TestTool-6.0 --version 0.12.6 as suggested on https://www.nuget.org/packages/Amazon.Lambda.TestTool-6.0
Just ensure it is installed at %USERPROFILE%\.dotnet\tools\dotnet-lambda-test-tool-6.0.exe
I got the same issue with VS2019 with lambda design in 3.1 version and in Output window getting error
The target process exited without raising a CoreCLR started event. Ensure that the target process is configured to use .NET Core. This may be expected if the target process did not run on .NET Core.
Then checked the folder having multiple version of lambda-test-tool in path
C:\Users{username}.dotnet\tools
I removed all the lambda-test-tool and installed the required tool only with version 3.1 by command in developer command prompt:
dotnet tool install -g --version 0.10 Amazon.Lambda.TestTool-3.1
Then I can able to debug the lambda
While doing some web development, I needed to have Memcached (source code) installed on my local machine to closely simulate what was going on my server.
How to install Memcached on Windows?
Steps to install Memcached on Windows:
Download a stable version, in either 32-bit or 64-bit I have tested the 64-bit version.
Unzip it in some hard drive folder. For example C:\memcached
There will be memcached.exe file in the unzipped folder.
Open a command prompt (need to be opened as administrator).
Run c:\memcached\memcached.exe -d install
For start and stop run following command line
c:\memcached\memcached.exe -d start
c:\memcached\memcached.exe -d stop
As told in some previous comments the v1.4.4 is sometimes coming from a trusted source, sometimes not and it becomes hard to find. But there is now a very stable Windows native port for both 32 bits and 64 bits versions.
https://github.com/jefyt/memcached-windows
It's running well on our two PHP servers (PHP7 and PHP8).
Hope this helps.
Another Cygwin version is also available here and runs well too
https://github.com/nono303/memcached
I’m constantly failing to install Platform IO IDE for Visual Studio Code or Atom. I’m working on OSX with High Sierra.
I have two users, both are Admins. The first user can install with VSC and Atom just fine. The second user always gets this error message:
PIP: Error: spawn /Volumes/Macintosh
HD/Users/micha/.platformio/penv/bin/pip ENOENT
I already tried to delete the .platformio folder and start over, without success. The error shows up for Visual Studio Code and Atom.
Any ideas?
Well, not a solution, but a suitable workaround.
I installed platformio core with homebrew, which works fine. Then I installed the IDE plugin, which seams to detect that the core is already there and does not try to instal it a second time.
I did this for Visual Studio Code.
I am on Windows, I tried to install platform-io vs extension to use exsting anaconda.
After setting platformio-ide.useBuiltinPIOCore to false and platformio-ide.customPATH to "path/to/py27", I am able to install platformio with existing python vEnv, but it ended up in an endless loop [press restart -> checking install -> please restart]
After adjusting the customPath to pointing to both pio.exe and python.exe residing directory, it works all right:
platformio-ide.customPATH: "path/to/py27;path/to/py27/Scripts"
I think you can adjust these setting to make these two users use seperate venv, so that there won't be any permission conflict or related issues.
Ember-cli is building very slowly with ember server on windows.
Build successful - 13126ms.
Slowest Trees | Total
-------------------------------+----------------
TreeMerger (vendor) | 3154ms
TreeMerger (stylesAndVendor) | 2051ms
TreeMerger (appAndDependencies) | 1914ms
StaticCompiler | 1791ms
This is in contrast to the same project building in less that 1 second on a linux box.
There are two big culprits:
Real time file system scanning or protection
Realtime-protection from Windows Defender (also know as Microsoft Security Essentials in win7)
Windows Search Indexing
Antivirus scanning
Unused files in your bower_components folder
Real time Scanning
During a build numerous files are generate in the ./tmp folder of the ember project, both the indexer and the realtime-protection make additional reads of each file which adds a significant amount of additional file I/O operations.
The fix is to:
exclude node.exe and/or the ./tmp folder from realtime-protection, and
exclude the folder from indexing.
Disable real-time antivirus scanning
This should get your build time down to a couple seconds. Additional speed improvements for Windows are being investigated continuing to be investigated in relation to Broccoli's handling of the build process.
Managing unused bower files
Having lots of files in the bower_components is the biggest culprit.
I wrote up a script, clean-ember-cli.js, that deletes everything but ember-cli dependancies, and anything imported in the Brocfile.js. I'm getting back to around 5 second build times.
Update
Reports are that running console as admin also helps.
Official recommendation from ember-cli to improve its performance on windows
Install ember-cli-windows with node using the below command
npm install -g ember-cli-windows
Run the following command on your project root folder
ember-cli-windows
mind one important thing... and I didn`t found out in any forum... if you are working with a laptop and you are not connected with AC, windows may run in low performance mode to keep battery. This cause ember build proyects 4 times slower
Using ember-cli 1.13.13 with a command prompt running as an administrator fixed it for me
In addition to answers provided above run
ember s
in powershell in admin mode. This enables symlinks which are not enabled by default in windows. Having symlinks creates a flatter node_modules folder which results in faster running times.
(Source)
From build 20262 Windows 10 have WSL 2.
This is Linux on your machine and gives us performance as good as
on Linux.
Get last Ubuntu from Microsoft store.
Do not use /mnt/ folder for repo because of slow speed,
use ~ folder.
Connect with terminal on Ubuntu and clone your repository.
cd ~
git clone your-repo
install node version manager and node
Install ember-cli and start server.
npm install -g ember-cli
cd ~/your-repo
npm i
ember serve
In VSCode install plugin "Remote - WSL", open your repo and start development.
With Windows 7 I got a 50% improvement by turning off Encrypting File System (EFS) for the project's /tmp directory. (right-click Properties->Advanced->Encrypt contents...)
For later versions of Ember CLI running in admin mode as mentioned here and suggested by D-Go in his answer seems to be the way to go, assuming your company allows this.
If like me you are using GIT Bash to run Ember you may be interested in how to set it up to automatically run in admin mode here
All,
Likely a noob question, but being brand new to node.js I'm stuck and going in circles so looking for a little prodding in the right direction (my skills are .NET and browser JS).
My first node.js application will read the Windows serial port, so I want to use the voodootikigod / node-serialport module that seems to be the best one to use with node.js on Windows. I have followed the instructions to build it on windows by cloning the github source locally and use node-gyp to configure and build and that works successfully with no errors.
However, I need to install this into a local npm repository so I can 'require' it in my application. I'm using the new Visual Studio Node.js tools for VS (which are an excellent way for a .net developer to get started with node.js) however the included npm package manager can't install from a local folder.
So not knowing much about NPM I am assuming to install this into the local NPM repository with the following command line "npm install" from the local github folder, and it goes pulling all the dependencies but there is an embedded script that runs the following command "node-gyp rebuild" and it is here it falls over with the error: MSB4036 the "VCBuild" task is not found.
I'm using VS 2013 pro, and I thought VCbuild was replaced by MSbuild a while back. So it looks like I have to edit the script that node-gyp rebuild tries to run but I don't know enough about npm and node-gyp to sort this out.
It's likely a dumb newbie problem - can someone point me in the right direction? Thanks.
Do you have all the requirements in place for node-gyp on Windows (see the readme)? Windows 7 requires Python 2.7 and VS 2010 and Windows 8 requires VS 2012 C++.