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

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.

Related

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

When attempting to migrate, Truffle (nodeJS) waffles between two errors?

I'm using truffle with a Node.js project, and when I attempt to migrate the project, I get the following error:
Windows Script Host
However, when I use the suggested fix, which is to rename the truffle.js file to something other than truffle.js (i.e. truffle-config.js), then I get a different error:
Could not find suitable configuration file.
When I rename the configuration file back to "truffle.js", then I get the first error all over again.
The solutions I've tried have included using Windows Powershell to run the program and running the command npm install --force -g truffle, neither of which have worked. I've looked into the recommended solution (https://github.com/trufflesuite/truffle/issues/150), and none of the proposed solutions have worked so far.

I am unable to deploy my platypi demo app

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.

Downloading source files cache modernizr.load.1.5.4.js Grunt Build Stall

I have been using Yeoman to start building with web apps and such for maybe the last month. And I have been running into some issues and have been able to resolve most of them. However, now I am stuck.
I'm running MAC OS 10.6.8
I have reinstalled Yeoman and Node fixed my paths for (what I know) as global.
Running grunt in my app.
Forces me to run as sudo. (I think this is because this OS has password protected permissions for apps and programs to install/modify files.
** If I run grunt -f
Warning: Unable to write "dist/scripts/vendor/modernizr.js" file (Error code: EACCES). This error happens with most of the main tasks in grunt.
Running sudo grunt
grunt runs through the tasks just fine until the real issue I cannot locate an answer.
Running "modernizr" task
Enabled Extras
shiv
load
cssclasses
Looking for Modernizr references
in dist/styles/main.css
svg
input
Downloading source files
cache modernizr.load.1.5.4.js
And grunt will not finish this download of source files. When I ran grunt using force it would complete the download. I am looking for a solution for the 2nd list item. Any assistance would be helpful.
Found out that there some glitch in the npm grunt-modernizr.
I used this code:
npm remove grunt-moderizr && npm install --save-dev grunt-modernizr
found here: https://github.com/Modernizr/grunt-modernizr/issues/48

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