I am unable to deploy my platypi demo app - node.js

I have been following the instructions on how to get started with platypi on https://platypi.io/docs/getting-started.
Everything was going well, until I tried to create the deployment package (https://platypi.io/docs/getting-started/1251/Deploy-to-a-Device).
When I run the node command "grunt build-cordova" I get the following error: "Error: Failed to run 'ant -version'...". So I tried installing ant first by entering the command "npm install node-ant".
However, when I do so, I get an error saying that I need to have Visual Studio 2010 build tools installed.
I do not want to install VS 2010 just to install ant, since I already have VS 2013 and 2015 installed.
My question is: How can I get the grunt command "grunt build-cordova" to work without installing VS 2010?
Thank you.

Did you try installing Ant directly from the site?
Download the binary and put it somewhere on your computer (I used C:\apache-ant-1.9.4), then add the path to the installed location to your PATH environment variable. You can find out how to do that here, the instructions are for java, but it works for other variables.
I added an ANT_HOME environment variable with a value of "C:\apache-ant-1.9.4". Then I edited my Path to include %ANT_HOME%; at the end.
Afterwards you will need to restart any open command prompts. You may also have to run npm uninstall node-ant to avoid conflicts.

Related

npm error after installing Node.js: Cannot find module 'es6-promisify'

I have installed the latets version of Node.js for Windows. Whatever command I use I always get the same exception, i.e. when I type "npm -v" get this error message:
Cannot find module 'es6-promisify'
How to install "es6-promisify" when NPM is missing "es6-promisify" in the first place?
BTW, during the installation of Node.js a view dependencies try to access protected foldes inside external hard drives for no reason and the last error that stuck forever was the installation of Microsoft Visual Studio Code. It seems to me that those tools cannot be installed without giving 100% access to every folder on every partition you have. This seems wrong to me...
Step 1: Uninstall the NodeJs app from the system
Step 2: Goto the programFiles/nodejs -> delete node_modules folder
Step 3: Reinstall NodeJs app
By following these steps you can fix the issue.
I found out a solution to this issue. I had to unplug all external drives, restart Windows, delete the folder "node_modules" manually and finally I started the Node.js msi to repair the installtion (copies files to node_modules again). After theses steps NPM is working again.
Remember: Reparing the installation without deleting the node_modules folder manually was not sufficient.

How can i install vue cli?

I come here to solve this problem: I have installed node (Ver. 12.13.1) in my computer, then I use node -v to see if node are well installed, and yes, it is.
Later, I use npm install #vue/cli, it installs the framework, but when a do a vue --version throws me a error.
I have tried in the terminal of visual studio code and throws me the error too. I tried uninstall and install node, and do the before stuff again, but its not working, the error remains
What could I do? Why is this happening?
Error in english:
Cannot load file C:\Users\halva\AppData\Roaming\npm\vue.ps1.
The file C:\Users\halva\AppData\Roaming\npm\vue.ps1 is not digitally signed.
You cannot run this script on the current system.
For more information about the execution of scripts and execution policy settings,
see about_Execution_Policies at https: /go.microsoft.com/fwlink/?LinkID = 135170
Photos of the code:
PS Terminal and
Visual Studio Code Terminal
Can confirm this is a powershell issue:
Please read this github issue on the matter: https://github.com/vuejs/vue-cli/issues/3424
People have suggested getting the same issue with vue-cli installed globally.
Solution: delete the erroring file: File C:\Users\halva\AppData\Roaming\npm\vue.ps1.
Sidenote:
What I suggest is to not use powershell, and use something like gitbash: https://gitforwindows.org/ (but this is entirely an opinion)
this command help to get rid off error message and execute the command, I am sharing here for help, looks like you should be sure whatever libraries you are using they are safe for your computer.
>Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Source https://github.com/vuejs/vue-cli/issues/3424
You should install vue-cli globally
npm install -g #vue/cli

node 6.11.3 NODE_EXE not found in IntelliJ

I've updated my project to use node 6.11.3. When I now try to start a npm-script by using the Run-configurations provided from IntelliJ, I always receive the following error:
Error: Failed to replace env in config: ${NODE_EXE}
Important: This error appears only if I start npm from within my project. If I use the windows cmd, the error doesn't appear.
What could possibly have changed between node 6.11.2 and 6.11.3? Because with the prior version, everything worked fine.
A workaround for me is to add the NODE_EXE variable to my run configuration, but In my opinion, that shouldn't be needed, because it worked in 6.11.2 too.
Looks as if you have ${NODE_EXE} variable set in one of your npmrc files (see https://docs.npmjs.com/files/npmrc#files), and it can't be properly expanded for some reason when you run your script in the IDE.
is the issue specific to certain project?
how many npm versions do you have installed? Please check that npm chosen in Node.js Interpreters dialog is the same as you use in cmd shell?
please create an env.js file with console.log(process.env) and try running it via npm ("env" : "node env.js") in both cmd console and WebStorm - what is the result?

(Visual Studio Code & NodeJS) - Could not install typings files for JavaScript language features?

I had installed latest NVM and used it to install NodeJS (macOS). Everything was okay, NodeJS ran normally. But when I started VS Code the following message appeared:
Could not install typings files for JavaScript language features. Please ensure that NPM is installed or configure 'typescript.npm' in your user settings
So I tried to find more official information from VS Code team. They said to insert the path to the npm executable file in the typescript.npm setting.
I used $ which npm to find the npm directory :
/Users/myusername/.nvm/versions/node/v8.3.0/bin/npm
but there is no executable file there. I also tried to insert this address into VSCode typescript.npm setting but it did not work.
My question is, where can I find the npm executable file address on macOS to insert into this typescript.npm setting so the error wouldn't pop up anymore ?
Thank you!
Releated VSCode issue: link Maybe it will help you.

Error code: 800A1391 Source: Microsoft JScript runtime error Running Grunt - Module is undefined

New Grunt user here who is using a lot of new tools (npm nodejs) today.
I've got Grunt "installed" and have been able to create a grunt.js file using the init task as described here: http://net.tutsplus.com/tutorials/javascript-ajax/meeting-grunt-the-build-tool-for-javascript/ and here: https://github.com/cowboy/grunt/blob/master/docs/getting_started.md. But whenever I run the "grunt" command I get an error:
Windows Script Host
Script: c:\users\[]\Documents\code\grunt\grunt.js
Line: 2
Char: 1
Error: 'module' is undefined
Code: 800A1391
Source: Microsoft JScript runtime error
As explained in the FAQ, you need to type grunt.cmd instead on Windows because the OS tries to launch grunt.js
Or you can install grunt-cli globally instead. This package will run any version of Grunt if it's been installed locally to your project.
SOLVED !!
So, this problem occur because windows by default associative < *.js > files
with >>
"Microsoft Windows Based Script Host".
grunt need to open by default with (grunt.cmd).
it easy to slove, by change default app (open with..)
Guide :
Go to any javascript file with "js" extension. (any file)
Right-Click(mouse) > Properties > "Opens with:" Change...(button)
Choose Notepad ( or any javascript IDE ).
PROBLEM SOLVED ! :)
good luck
If you're getting a "Microsoft JScript runtime error" that means that node.js isn't even getting invoked; instead Windows Script Host is trying to run your code. That's probably a problem with filetype associations; IIRC Windows defaults to trying to execute a ".js" file with WSH. You may wind up having to create a shortcut to your script, specifying a command line (probably something like "node %1") and a starting directory in order to make sure that it's executed properly.
It would help if you could tell us exactly how you're trying to invoke your code.
it seems that in the latest versions of the grunt modules, you would have to do the following to have it work under windows:
remove any globally installed grunt
npm uninstall -g grunt
install grunt-cli globally
npm install -g grunt-cli
install grunt locally into your project
npm install grunt
installing grunt (v0.4.x) globally does not seem to create the necessary grunt.cmd anymore. it seems that the recommendation is now to have grunt installed locally to be able to use version-specific Gruntfiles
As Florian F suggested, running grunt.cmd works. This is because of the process Windows is looking for your grunt command.
When typing grunt -h Windows will proceed to look for the following files:
./grunt.cmd
./grunt.* (grunt.js is found in this case which is why you see "module is undefined")
%APPDATA%/npm/grunt.cmd
An alternative to using "grunt.cmd" is to use grunter which simply renames the command to grunter... then you no longer have this problem.
To answer this, first we need to understand that the error is caused because it is being executed by Windows Script Host.
Now, run the code from your cmd promt with the following syntax:
>node <application_name>.js
this will allow the Node.js application to open through V8 JavaScript engine(Google's).
P.S: Please reply back if this has helped in resolving your issue else post the problem you are facing after trying this.
I had a similar issue, the problem is file association, I would recommend:
right click on a .js file and choose open with.
then you choose nodejs/node.exe (somewhere in "program files" folder
then make tick box where it says "always open .js files " (paraphrasing)
That should do the trick.
I went through the same issue when running an old Node project.
The issue was with the name of the js file, it was node.js. So the while running the command node node.js, it was opening up a windows dialogue box.
I just changed the name of the file to app.js and the error flew away.
So, in my case i had tryed all the mentioned above with no result.
But i have fund that im dont type: node in the full sentence as the following snipet
node script.js.And remember never understimate your own miscoding.
Solution:
Go to any javascript file with "js" extension. (any file)
Right-Click(mouse) > Properties > "Opens with:" Change...(button)
Choose Notepad ( or any Javascript IDE like VS Code ).

Resources